INSERT error in SERVER connection type

chao jing
  • chao jing

    chao jing - 2010-12-15

    I use hsql in server way to run, and i use java JDBC client to connect. But sometimes it throw exception when i insert or update data.Exception message like this "java.sql.SQLException: transaction rollback: serialization failure". I use transaction in my code.
    How this exception cause by? And any suggestions??I have no idea. This question is important for me, please reply as soon as possible, Thank you very much~

  • chao jing

    chao jing - 2010-12-15

    this is whole exception stack message.
    Caused by: java.sql.SQLException: transaction rollback: serialization failure
    at org.hsqldb.jdbc.Util.sqlException(
    at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(
    at org.hsqldb.jdbc.JDBCPreparedStatement.execute(
    at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.logicalcobwebs.proxool.ProxyStatement.invoke(
    at org.logicalcobwebs.proxool.ProxyStatement.intercept(
    at $java.sql.PreparedStatement$$EnhancerByProxool$$b300ca78.execute(<generated>)
    My hsql version is lastest

  • Fred Toussi

    Fred Toussi - 2010-12-15

    This exception is caused by multiple updates on the same object (in MVCC mode), or by deadlock prevention (in all modes). It really depends on what your different transactions are doing.

  • chao jing

    chao jing - 2010-12-18

    Thank you.
    I have two thread, first one insert value, last one will update value what insert before.
    Sometimes this excpetion occur when i insert data in transaction, in the transaction i insert data into two tables.these is the same cause of ?? How can i avoid this exception? change transaction level ?

  • Fred Toussi

    Fred Toussi - 2010-12-18

    It is difficult to say without knowing your application. With MVCC, the INSERT thread shouldn't have a problem at all. The update thread can update the rows when the INSERT thread has committed.

    In LOCKS mode, if you insert into two tables, the transactions must insert and update the tables in the same order, for example table A first, then table B.

  • chao jing

    chao jing - 2010-12-21

    I think I find the problem, thank you very much

  • FHaselbein2

    FHaselbein2 - 2011-06-01

    Hello JingChao,
    I'm having the same problem, in a webapplication where users concurrently execute actions (e.g. save objects they are editing).
    How did you solve the problem?
    Bye Michael

  • MadKroLL

    MadKroLL - 2013-05-22

    How did you solve the problem? What was the cause?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks