-
Jul 20th, 2010, 08:39 AM
#1
'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?
-
Jul 20th, 2010, 10:33 AM
#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
-
Jul 20th, 2010, 10:49 AM
#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 ;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules