Rollback failure

431 views
Skip to first unread message

Kerry Sainsbury

unread,
Dec 8, 2009, 10:57:23 PM12/8/09
to h2-da...@googlegroups.com
Hi Thomas,

I've deployed the latest version of H2 and am encountering problems with rollback. I don't have a good test case, but here's the stack trace if it helps:

 Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
    [junit] org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
    [junit]     at org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:618)
    [junit]     at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)
    [junit]     at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)
    [junit]     at org.springframework.test.context.transaction.TransactionalTestExecutionListener.endTransaction(TransactionalTestExecutionListener.java:353)
    [junit]     at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:199)
    [junit]     at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:340)
    [junit]     at org.springframework.test.context.junit4.SpringMethodRoadie.runAfters(SpringMethodRoadie.java:351)
    [junit]     at org.springframework.test.context.junit4.SpringMethodRoadie.runBeforesThenTestThenAfters(SpringMethodRoadie.java:262)
    [junit]     at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:234)
    [junit]     at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:204)
    [junit]     at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:146)
    [junit]     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:151)
    [junit] Caused by: org.hibernate.TransactionException: JDBC rollback failed
    [junit]     at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:204)
    [junit]     at org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:615)
    [junit] Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.ArrayIndexOutOfBoundsException: 194"; SQL statement:
    [junit] ROLLBACK [50000-125]
    [junit]     at org.h2.message.Message.getSQLException(Message.java:111)
    [junit]     at org.h2.message.Message.convert(Message.java:288)
    [junit]     at org.h2.table.TableData.removeRow(TableData.java:390)
    [junit]     at org.h2.log.UndoLogRecord.undo(UndoLogRecord.java:105)
    [junit]     at org.h2.engine.Session.rollbackTo(Session.java:530)
    [junit]     at org.h2.engine.Session.rollback(Session.java:507)
    [junit]     at org.h2.command.dml.TransactionCommand.update(TransactionCommand.java:125)
    [junit]     at org.h2.command.CommandContainer.update(CommandContainer.java:71)
    [junit]     at org.h2.command.Command.executeUpdate(Command.java:201)
    [junit]     at org.h2.jdbc.JdbcConnection.rollbackInternal(JdbcConnection.java:1391)
    [junit]     at org.h2.jdbc.JdbcConnection.rollback(JdbcConnection.java:432)
    [junit]     at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:217)
    [junit]     at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:196)
    [junit] Caused by: java.lang.ArrayIndexOutOfBoundsException: 194
    [junit]     at org.h2.index.PageBtree.getRow(PageBtree.java:167)
    [junit]     at org.h2.index.PageBtreeLeaf.remove(PageBtreeLeaf.java:208)
    [junit]     at org.h2.index.PageBtreeNode.remove(PageBtreeNode.java:325)
    [junit]     at org.h2.index.PageBtreeIndex.remove(PageBtreeIndex.java:230)
    [junit]     at org.h2.table.TableData.removeRow(TableData.java:371)


This is not a problem in the 1.1.118 version of the code.

Let me know if there's anything I can do to help.

Cheers
Kerry

Thomas Mueller

unread,
Dec 9, 2009, 1:33:05 AM12/9/09
to h2-da...@googlegroups.com
Hi,

This doesn't sound good... Could you send me the database? Is this
problem reproducible with a fresh database? Some more questions:

- What is your database URL?
- Did you use multiple connections?
- With which version of H2 was this database created?
You can find it out using:
select * from information_schema.settings where name='CREATE_BUILD'
or have a look in the SQL script created by the recover tool.
- Did the application run out of memory (once, or multiple times)?
- Do you use any settings or special features (for example, the setting
LOG=0, or two phase commit, linked tables, cache settings)?
- Is the application multi-threaded?
- What operating system, file system, and virtual machine
(java -version) do you use?
- Is it (or was it at some point) a networked file system?
- How big is the database (file sizes)?
- Is the database usually closed normally, or is process terminated
forcefully or the computer switched off?
- Are there any other exceptions (maybe in the .trace.db file)?
Could you send them please?
- Do you still have any .trace.db files, and if yes could you send them?

Regards,
Thomas
> --
>
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To post to this group, send email to h2-da...@googlegroups.com.
> To unsubscribe from this group, send email to
> h2-database...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/h2-database?hl=en.
>

Thomas Mueller

unread,
Dec 10, 2009, 1:50:17 PM12/10/09
to h2-da...@googlegroups.com
Hi,

I could now reproduce the problem with a simple test case. It will be
fixed in the next release (probably this weekend).

Thanks a lot for your help!

Regards,
Thomas

Thomas Mueller

unread,
Dec 14, 2009, 2:49:27 PM12/14/09
to h2-da...@googlegroups.com
Hi,

I'm sorry, there was no release this weekend. The reason is, there was
another quite important bug (processing IN(...) conditions). I think
the next release will be on Thursday.

Regards,
Thomas
Reply all
Reply to author
Forward
0 new messages