Greetings, I am a user only but my understanding is:
1) please use the latest H2 release since anything prior 2.3.232 had serious issues 2) unless you can show a Java only, self containing (and free of third- party software) reproducer, nobody will be able to help you Personal experience: We are running 21 large databases (e.g. 20GB data each, 120 indexed tables) using H2 2.3.239 Snapshot in a multi country, multi user environment, massive daily DML. It runs mostly stable, but depends on regular "SHUTDOWN DEFRAG" (or else db file will explode). Corruption seems to occur sometimes (like 1/100?), but was always recoverable. Important: set the TEMP folder explicitly for very large databases because H2 will create large temp files (easily exhausting the default /tmp size). Good luck and cheers Andreas On Fri, 2025-01-10 at 12:08 +0530, 'Balamurali Krishna Ippili' via H2 Database wrote: > Hi Team, > > We are getting a DB corruption issue intermittently with H2DB 2.2.224 > version and following are the error details: > > =================================================ERROR > START================================================================ > ==== > Exception while CRUD field mappings getNimMdrFieldMappingsByMdr > org.h2.jdbc.JdbcSQLNonTransientConnectionException: File corrupted > while reading record: > "/opt/cloakware/cspmserver_thirdparty/tomcat/webapps/ca-nim-sm/WEB- > INF/data/nim-sm-customizations.mv.db". Possible solution: use the > recovery tool [90030-224] > at > org.h2.message.DbException.getJdbcSQLException(DbException.java:690) > ~[h2-2.2.224.jar:2.2.224] > at > org.h2.message.DbException.getJdbcSQLException(DbException.java:489) > ~[h2-2.2.224.jar:2.2.224] > at org.h2.message.DbException.get(DbException.java:212) ~[h2- > 2.2.224.jar:2.2.224] > at org.h2.mvstore.db.Store.convertMVStoreException(Store.java:163) > ~[h2-2.2.224.jar:2.2.224] > at org.h2.mvstore.db.Store.<init>(Store.java:142) ~[h2- > 2.2.224.jar:2.2.224] > at org.h2.engine.Database.<init>(Database.java:326) ~[h2- > 2.2.224.jar:2.2.224] > at org.h2.engine.Engine.openSession(Engine.java:92) ~[h2- > 2.2.224.jar:2.2.224] > at org.h2.engine.Engine.openSession(Engine.java:222) ~[h2- > 2.2.224.jar:2.2.224] > at org.h2.engine.Engine.createSession(Engine.java:201) ~[h2- > 2.2.224.jar:2.2.224] > at > org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav > a:343) ~[h2-2.2.224.jar:2.2.224] > at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:125) ~[h2- > 2.2.224.jar:2.2.224] > at org.h2.Driver.connect(Driver.java:59) ~[h2-2.2.224.jar:1.3.176] > at java.sql.DriverManager.getConnection(DriverManager.java:664) > ~[?:1.8.0_432] > at java.sql.DriverManager.getConnection(DriverManager.java:208) > ~[?:1.8.0_432] > at > com.j256.ormlite.jdbc.JdbcConnectionSource.makeConnection(JdbcConnect > ionSource.java:252) ~[ormlite-jdbc-4.48.jar:?] > at > com.j256.ormlite.jdbc.JdbcConnectionSource.getReadWriteConnection(Jdb > cConnectionSource.java:184) ~[ormlite-jdbc-4.48.jar:?] > at > com.j256.ormlite.jdbc.JdbcConnectionSource.getReadOnlyConnection(Jdbc > ConnectionSource.java:170) ~[ormlite-jdbc-4.48.jar:?] > at > com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecut > or.java:243) ~[ormlite-core-4.48.jar:?] > at > com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java: > 196) ~[ormlite-core-4.48.jar:?] > at com.j256.ormlite.dao.BaseDaoImpl.query(BaseDaoImpl.java:265) > ~[ormlite-core-4.48.jar:?] > at > com.ca.integration.normalization.common.persistence.FieldMappingsDbPe > rsistenceImpl.getNimMdrFieldMappingsByMdr(FieldMappingsDbPersistenceI > mpl.java:139) ~[ca-nim-common-1.0.0-SNAPSHOT.jar:1.0.0-SNAPSHOT] > at > com.ca.integration.normalization.common.SMFieldMappingHandler.cloneMa > ppings(SMFieldMappingHandler.java:1437) ~[ca-nim-sm-core-3.2.0- > SNAPSHOT.jar:3.2.0-SNAPSHOT] > > =================================================ERROR > END================================================================== > == > > The DB is getting corrupted when we are reading a table which > contains only 225 records in it. It is not a huge DB or we don't have > more than 20 small tables init. The issue is occurring intermittently > and not able to understand the pattern but it is failing with the > same error message > "org.h2.jdbc.JdbcSQLNonTransientConnectionException: File corrupted > while reading record:", This is occurring on the fly when the > application is running and we cannot use the recovery tool here as > suggested in the error message "Possible solution: use the recovery > tool [90030-224]" > > The getNimMdrFieldMappingsByMdr function is just reading 225 > records(key value pair data) from a H2DB table but it is not > successful sometimes with no reason other than reporting the DB > corruption issue. > > > Following are the details: > =================== > H2 DB version - 2.2.224 > Java version : OpenJDK8 > Application Server : Tomcat 9.x > > Can any one help here to understand the issue and suggest on how to > address this issue? Let me know if we have a quick call to check the > same. > > > Thanks, > Balamurali > > > > > > This electronic communication and the information and any files > transmitted with it, or attached to it, are confidential and are > intended solely for the use of the individual or entity to whom it is > addressed and may contain information that is confidential, legally > privileged, protected by privacy laws, or otherwise restricted from > disclosure to anyone else. If you are not the intended recipient or > the person responsible for delivering the e-mail to the intended > recipient, you are hereby notified that any use, copying, > distributing, dissemination, forwarding, printing, or copying of this > e-mail is strictly prohibited. If you received this e-mail in error, > please return the e-mail to the sender, delete it from your computer, > and destroy any printed copy of it. > -- > You received this message because you are subscribed to the Google > Groups "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/h2-database/CAG6_yCCDoFrpeVx6%3DgS6_FGh4LiKi94Wqegghmi20SijMRgvqg%40mail.gmail.com > [1]. [1] https://groups.google.com/d/msgid/h2-database/CAG6_yCCDoFrpeVx6%3DgS6_FGh4LiKi94Wqegghmi20SijMRgvqg%40mail.gmail.com https://groups.google.com/d/msgid/h2-database/CAG6_yCCDoFrpeVx6%3DgS6_FGh4LiKi94Wqegghmi20SijMRgvqg%40mail.gmail.com?utm_medium=email&utm_source=footer -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/h2-database/9aff767c7ace85369b2d0e88ed2958d62c43eb8a.camel%40manticore-projects.com.
