Announcement Announcement Module
Collapse
No announcement yet.
'Version' field in mysql Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • '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
    '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

    Comment


    • #3
      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 ;

      Comment

      Working...
      X