Menu

[Hibernate] OOM and data corruption

Help
Jaden Park
2015-01-01
2015-01-01
  • Jaden Park

    Jaden Park - 2015-01-01

    We have a system component which uses hsqldb and hibernate (specifically, we use hsqldb 1.8.0.7 and hibernate 3.6.10). The component has several threads which constantly reads and writes from and to various tables in the database.

    Lately, we have seen a corruption in the DB: two fields from a row for table A was inserted into table B. One curious fact is that table B requires only two fields: a string and a byte array, while table A requires a string and a byte array among many things. Logs of the component indicates an out of memory error:

    WARN 794908270@mrpc-7907: SQLException doing action 'Performing a transaction':
    org.hibernate.exception.GenericJDBCException: could not execute query
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.loader.Loader.doList(Loader.java:2545)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
    at org.hibernate.loader.Loader.list(Loader.java:2271)
    at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1716)
    at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
    ...
    Caused by: java.sql.SQLException: out of memory
    at org.hsqldb.jdbc.Util.throwError(Unknown Source)
    at org.hsqldb.jdbc.jdbcPreparedStatement.executeQuery(Unknown Source)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
    at org.hibernate.loader.Loader.doQuery(Loader.java:802)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    at org.hibernate.loader.Loader.doList(Loader.java:2542)
    ... 24 more

    I'm very certain other data paths are not corrupted, and there exists a strong correlation between the time of OOM error and the data corruption.

    Has anyone came across some similar symptoms or have insight regarding this issue? Thanks.

     
  • Fred Toussi

    Fred Toussi - 2015-01-01

    Such issues may occur with very old versions of HSQLDB. You can upgrade to 2.3.2.

     

Log in to post a comment.