It is actually create only. No drop. What it does is it creates the database from the hibernate mapping. Then I use DB_CLOSE_ON_EXIT=FALSE to make sure data is not cleaned on JVM exit. But the problem is the identity sequence number always start with 1 when the hibernate session is started. Looking at the H2 trace logs I see that it recreates the sequence:
09-23 18:54:18 pageStore: log redo + table:0 s:2 ( /* key:37 */ 8, 0, 3, 'CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_F8E46337_B216_465F_8D40_8A221BF676B5 START WITH 1 BELONGS_TO_TABLE') 09-23 18:54:18 index: T0_DATA add ( /* key:37 */ 8, 0, 3, 'CREATE SEQUENCE PUBLIC.SYSTEM_SEQUENCE_F8E46337_B216_465F_8D40_8A221BF676B5 START WITH 1 BELONGS_TO_TABLE') 09-23 18:54:18 pageStore: log redo + table:-1 s:2 ( /* key:10 */ 9, 0, 9, 515, 'OFF,0,,', '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 On Sep 24, 12:30 am, Ryan How <[email protected]> wrote: > Hi, > > What is this Drop and re-create database schema on startup? > > Maybe that is resetting the sequence... > > And the MVCC setting is for row level locking, which from what some > others have said seems to help with deadlock issues when using hibernate. > > Ryan > > On 24/09/2010 6:40 AM, mcevikce wrote: > > > > > <!-- Drop and re-create the database schema on startup --> > > <property name="hbm2ddl.auto">create</property> -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
