Please, anyone? Is there any other info I can put to help? This is serious! Must I stop the app with db, it will not run again, only this dreaded exception! Is there anything I can make to get it more stable? WHAT is happening anyway?
Thank you, Rogerio. On 28 jun, 19:38, Rogerio <[email protected]> wrote: > Hello, new user here... > > I am using h2 for the first time, embedded in a java application. > When I stop the app, almost every time the database will not open the > next time, and this is important for my project. > The exception I get is at the end of this text. > > The application has several threads that concurrently access the db, > each with a new connection, achieved with a ThreadLocal, whose > initialValue() returns a java.sql.Connection. > It seems to be recovering twice from the last shutdown, and stopping > on the second. > > PLEASE, what can I do??? The system is unreliable that way, the db is > there to guarantee that nothing gets lost in case of a crash, but the > app doesn´t even start in that case! > > Please help........... > > Thank you, > Rogerio. > > -------info-------- > > I get this with TRACE_LEVEL_SYSTEM_OUT=2: > > 06-28 19:17:32 database: opening C:\eclipse-workspaces\default\jImp2\db > \phasedb (build 155) > 06-28 19:17:33 database: opening C:\eclipse-workspaces\default\jImp2\db > \phasedb (build 155) > org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: > "PRIMARY KEY ON """".T19" [23505-155] > at... > > And with TRACE_LEVEL_SYSTEM_OUT=3, I can see the following: > > 06-28 19:03:23 database: opening C:\eclipse-workspaces\default\jImp2\db > \phasedb (build 155) > 06-28 19:03:23 fileLock: load {} > 06-28 19:03:23 fileLock: save > {id=130d84735e5ad5c74617c8027ff0204c077b8b142fd, method=file} > 06-28 19:03:23 fileLock: load {method=file, > id=130d84735e5ad5c74617c8027ff0204c077b8b142fd} > 06-28 19:03:23 pageStore: log recover > 06-28 19:03:23 pageStore: log recover stage:0 > 06-28 19:03:23 pageStore: pageIn.readPage 6 > 06-28 19:03:23 pageStore: log undo 3 > 06-28 19:03:23 pageStore: log undo 514 > 06-28 19:03:23 pageStore: log undo 4 > 06-28 19:03:23 pageStore: log commit 1 pos:6 > 06-28 19:03:23 pageStore: log commit 1 pos:8 > 06-28 19:03:23 pageStore: log undo 515 > 06-28 19:03:23 pageStore: log commit 2 pos:12 > 06-28 19:03:23 pageStore: log commit 2 pos:15 > 06-28 19:03:23 pageStore: log undo 516 > 06-28 19:03:23 pageStore: log commit 2 pos:19 > 06-28 19:03:23 pageStore: log commit 2 pos:22 > 06-28 19:03:23 pageStore: log undo 517 > 06-28 19:03:23 pageStore: log commit 2 pos:26 > 06-28 19:03:23 pageStore: log commit 2 pos:29 > 06-28 19:03:23 pageStore: log undo 518 > > ...41k lines here... > > 06-28 19:03:56 pageStore: log redo + table: 19 s:13 ( /* key:4 */ > 2601, > X'aced00057372002a736f667477617265657870726573732e6a696d70322e636f72652e647 > 46f2e5472616e73616374696f6e00000000000000010c00007870777f00000005000001303e > d3fc10000009ee0002d9f7bd868c286d78640a00617c3533307c353535397c4954303032202 > 0207c34387c333030307c3031317c35323635317c35343931363730323730312a2a2a2a2a2a > 2a2a2a2a7c313530357c7c317c7c7c317c3830323630383031333238323334347c7c7c7c7c7 > c7c7c7c7c7c78') > 06-28 19:03:56 index: T19_DATA add ( /* key:4 */ 2601, > X'aced00057372002a736f667477617265657870726573732e6a696d70322e636f72652e647 > 46f2e5472616e73616374696f6e00000000000000010c00007870777f00000005000001303e > d3fc10000009ee0002d9f7bd868c286d78640a00617c3533307c353535397c4954303032202 > 0207c34387c333030307c3031317c35323635317c35343931363730323730312a2a2a2a2a2a > 2a2a2a2a7c313530357c7c317c7c7c317c3830323630383031333238323334347c7c7c7c7c7 > c7c7c7c7c7c78') > 06-28 19:03:56 pageStore: close > 06-28 19:03:56 pageStore: log close > 06-28 19:03:56 pageStore: close > 06-28 19:03:56 fileLock: load {method=file, > id=130d84735e5ad5c74617c8027ff0204c077b8b142fd} > 06-28 19:03:56 database: opening C:\eclipse-workspaces\default\jImp2\db > \phasedb (build 155) > 06-28 19:03:56 fileLock: load {} > 06-28 19:03:56 fileLock: save > {id=130d847b8b7c61f7b5f01e133a0fb2b101ed3df2c4e, method=file} > 06-28 19:03:56 fileLock: watchdog end > 06-28 19:03:57 fileLock: load {method=file, > id=130d847b8b7c61f7b5f01e133a0fb2b101ed3df2c4e} > 06-28 19:03:57 pageStore: log recover > 06-28 19:03:57 pageStore: log recover stage:0 > 06-28 19:03:57 pageStore: pageIn.readPage 6 > 06-28 19:03:57 pageStore: log undo 3 > 06-28 19:03:57 pageStore: log undo 514 > 06-28 19:03:57 pageStore: log undo 4 > 06-28 19:03:57 pageStore: log commit 1 pos:6 > 06-28 19:03:57 pageStore: log commit 1 pos:8 > 06-28 19:03:57 pageStore: log undo 515 > 06-28 19:03:57 pageStore: log commit 2 pos:12 > > ...41k lines more... > > 06-28 19:04:50 pageStore: log redo + table: 19 s:13 ( /* key:4 */ > 2601, > X'aced00057372002a736f667477617265657870726573732e6a696d70322e636f72652e647 > 46f2e5472616e73616374696f6e00000000000000010c00007870777f00000005000001303e > d3fc10000009ee0002d9f7bd868c286d78640a00617c3533307c353535397c4954303032202 > 0207c34387c333030307c3031317c35323635317c35343931363730323730312a2a2a2a2a2a > 2a2a2a2a7c313530357c7c317c7c7c317c3830323630383031333238323334347c7c7c7c7c7 > c7c7c7c7c7c78') > 06-28 19:04:50 index: T19_DATA add ( /* key:4 */ 2601, > X'aced00057372002a736f667477617265657870726573732e6a696d70322e636f72652e647 > 46f2e5472616e73616374696f6e00000000000000010c00007870777f00000005000001303e > d3fc10000009ee0002d9f7bd868c286d78640a00617c3533307c353535397c4954303032202 > 0207c34387c333030307c3031317c35323635317c35343931363730323730312a2a2a2a2a2a > 2a2a2a2a7c313530357c7c317c7c7c317c3830323630383031333238323334347c7c7c7c7c7 > c7c7c7c7c7c78') > 06-28 19:04:50 pageStore: close > 06-28 19:04:50 pageStore: log close > 06-28 19:04:50 pageStore: close > 06-28 19:04:50 fileLock: load {method=file, > id=130d847b8b7c61f7b5f01e133a0fb2b101ed3df2c4e} > org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: > "PRIMARY KEY ON """".T19" [23505-155] > at... > > --------exception-------- > org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: > "PRIMARY KEY ON """".T19" [23505-155] > at org.h2.message.DbException.getJdbcSQLException(DbException.java: > 327) > at org.h2.message.DbException.get(DbException.java:167) > at org.h2.message.DbException.get(DbException.java:144) > at > org.h2.index.PageDataIndex.getNewDuplicateKeyException(PageDataIndex.java: > 157) > at org.h2.index.PageDataIndex.add(PageDataIndex.java:135) > at org.h2.table.RegularTable.addRow(RegularTable.java:127) > at org.h2.store.PageStore.redo(PageStore.java:1470) > at org.h2.store.PageLog.recover(PageLog.java:316) > at org.h2.store.PageStore.recover(PageStore.java:1324) > at org.h2.store.PageStore.openExisting(PageStore.java:349) > at org.h2.store.PageStore.open(PageStore.java:273) > at org.h2.engine.Database.getPageStore(Database.java:2039) > at org.h2.engine.Database.open(Database.java:547) > at org.h2.engine.Database.openDatabase(Database.java:218) > at org.h2.engine.Database.<init>(Database.java:213) > at org.h2.engine.Engine.openSession(Engine.java:56) > at org.h2.engine.Engine.openSession(Engine.java:159) > at org.h2.engine.Engine.createSessionAndValidate(Engine.java:138) > at org.h2.engine.Engine.createSession(Engine.java:121) > at org.h2.engine.Engine.createSession(Engine.java:28) > at > org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java: > 285) > at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:112) > at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:96) > at org.h2.Driver.connect(Driver.java:72) > at java.sql.DriverManager.getConnection(Unknown Source) > at java.sql.DriverManager.getConnection(Unknown Source) > at softwareexpress.framework.phaseprocessor.core.Pool > $1.initialValue(Pool.java:33) > at softwareexpress.framework.phaseprocessor.core.Pool > $1.initialValue(Pool.java:1) > at java.lang.ThreadLocal.setInitialValue(Unknown Source) > at java.lang.ThreadLocal.get(Unknown Source) > at > softwareexpress.framework.phaseprocessor.core.Pool.createStatement(Pool.jav a: > 152) > at > softwareexpress.framework.phaseprocessor.core.ObjectPool.<init>(ObjectPool. > java: > 38) > at > softwareexpress.framework.phaseprocessor.core.ObjectPool.<init>(ObjectPool. > java: > 24) > at > softwareexpress.framework.phaseprocessor.core.Controller.<clinit>(Controlle > r.java: > 24) > at softwareexpress.framework.phaseprocessor.core.Pool > $1.initialValue(Pool.java:41) > at softwareexpress.framework.phaseprocessor.core.Pool > $1.initialValue(Pool.java:1) > at java.lang.ThreadLocal.setInitialValue(Unknown Source) > at java.lang.ThreadLocal.get(Unknown Source) > at > softwareexpress.framework.phaseprocessor.core.Pool.createStatement(Pool.jav a: > 152) > at > softwareexpress.framework.phaseprocessor.core.NumberPool.<init>(NumberPool. > java: > 32) > at softwareexpress.jimp2.Main.<clinit>(Main.java:30) -- 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.
