Results 1 to 3 of 3

Thread: 'Version' field in mysql

  1. #1

    Default 'Version' field in mysql

    In phpadmin, I do not see any field such as 'version', however scaffolding controllers request for a 'version' column from db and I observed that it exist when I connect with HeidiSQL client.

    What is that? Do you have any idea?

  2. #2
    Join Date
    Jul 2010
    Posts
    3

    Default

    'Version' is added in with an .aj (aspect j) file for your entity.
    The version field increments when the entity is updated. That way, when 2 threads are updating the same entity record, if the version of the entity you have updated does not match the entity in the database, an exception is thrown indicating that the record as been changed. In other words, you are protected from dirty reads when updating an entity which may have changed.

    K

  3. #3

    Default

    Oh I see, I was expecting something like that. When exactly 'version' field is created physically on my MySQL database? I can't see it from phpmyadmin management interface, and does not exist in the sql dump (see below)

    CREATE TABLE IF NOT EXISTS `log` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `date` datetime NOT NULL,
    `url` int(11) NOT NULL,
    `client` varchar(255) DEFAULT NULL,
    `platform` varchar(50) DEFAULT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •