concurrent mod error with h2mem

140 views
Skip to first unread message

Vijay Ragunathan

unread,
Jul 20, 2021, 2:06:03 PM7/20/21
to H2 Database

In one of our environments, we get:

org.h2.jdbc.JdbcSQLException: General error: "java.util.ConcurrentModificationException"; SQL statement: COMMIT [50000-197] ; SQLSTATE = HY000

URL is jdbc:h2:mem:test1
H2 version: 1.4.197

There were over 14k statements in the transaction. How can we address this?

Thank you

Vijay Ragunathan

unread,
Jul 20, 2021, 7:53:04 PM7/20/21
to H2 Database
Detailed stack:

Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.util.ConcurrentModificationException";
SQL statement: COMMIT [50000-197] 
at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
at org.h2.message.DbException.get(DbException.java:168) 
at org.h2.message.DbException.convert(DbException.java:307) 
at org.h2.command.Command.executeUpdate(Command.java:274) 
at org.h2.jdbc.JdbcConnection.commit(JdbcConnection.java:497) 
Caused by: java.util.ConcurrentModificationException 
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493) 
at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1516) 
at org.h2.engine.Session.commit(Session.java:700) 
at org.h2.command.dml.TransactionCommand.update(TransactionCommand.java:46) 
at org.h2.command.CommandContainer.update(CommandContainer.java:102) 
at org.h2.command.Command.executeUpdate(Command.java:261)

Vijay Ragunathan

unread,
Aug 2, 2021, 12:49:22 PM8/2/21
to H2 Database
Any thoughts on this?

Evgenij Ryazanov

unread,
Aug 2, 2021, 8:46:46 PM8/2/21
to H2 Database
Hello

You're using an entirely outdated version of H2 database, so it would be reasonable to test a latest version first.

Vijay Ragunathan

unread,
Aug 4, 2021, 1:11:11 PM8/4/21
to H2 Database
Thanks. Version 1.4.200 broke some tests and we had to stick with 1.4.197 for that release of the product. Is there a H2 bug that you think that is relevant which got fixed between the two?
Reply all
Reply to author
Forward
0 new messages