On a related note, note how we update the exact same row three times
(and acquire locks three times). Cayenne could group these calls into a
single call... (The log that follows results from a single
commitChanges() call).
16:55:45,062 INFO QueryLogger:315 - LOCK TABLES AUTO_PK_SUPPORT WRITE
16:55:45,062 INFO QueryLogger:315 - SELECT NEXT_ID FROM AUTO_PK_SUPPORT
WHERE TABLE_NAME = 'image'
16:55:45,078 INFO QueryLogger:315 - UPDATE AUTO_PK_SUPPORT SET NEXT_ID
= NEXT_ID + 20 WHERE TABLE_NAME = 'image' AND NEXT_ID = 3580
16:55:45,078 INFO QueryLogger:315 - UNLOCK TABLES
16:55:45,078 INFO QueryLogger:315 - LOCK TABLES AUTO_PK_SUPPORT WRITE
16:55:45,078 INFO QueryLogger:315 - SELECT NEXT_ID FROM AUTO_PK_SUPPORT
WHERE TABLE_NAME = 'image'
16:55:45,078 INFO QueryLogger:315 - UPDATE AUTO_PK_SUPPORT SET NEXT_ID
= NEXT_ID + 20 WHERE TABLE_NAME = 'image' AND NEXT_ID = 3600
16:55:45,078 INFO QueryLogger:315 - UNLOCK TABLES
16:55:45,078 INFO QueryLogger:315 - LOCK TABLES AUTO_PK_SUPPORT WRITE
16:55:45,093 INFO QueryLogger:315 - SELECT NEXT_ID FROM AUTO_PK_SUPPORT
WHERE TABLE_NAME = 'image'
16:55:45,093 INFO QueryLogger:315 - UPDATE AUTO_PK_SUPPORT SET NEXT_ID
= NEXT_ID + 20 WHERE TABLE_NAME = 'image' AND NEXT_ID = 3620
16:55:45,093 INFO QueryLogger:315 - UNLOCK TABLES
Gili
Gili wrote:
>
> Under MySQL, when we use AUTO_PK_SUPPORT we pessimistically lock the
> table as well as using optimistic locking. We should be doing one, not
> both. Do you guys see the same thing under other DBs?
>
> Gili
-- http://www.desktopbeautifier.com/
This archive was generated by hypermail 2.0.0 : Fri Sep 09 2005 - 17:01:31 EDT