[Biojava-l] Hibernate Exception when persisting some richsequence object to biosql schema

Richard Holland holland at eaglegenomics.com
Mon Jan 25 09:18:58 UTC 2010

This happens in one of two situations:

 1. Something else is modifying the database at the same time, e.g. if you are running the same piece of code in parallel.

 2. The Hibernate session has become inconsistent with the database (possibly due to partial or incomplete removal of cached objects because references to them remain elsewhere).

In your code, you're doing a lot of session.clear() and session.flush() and RichObjectFactory.clearLRUCache() calls - are these really necessary? Also your code is creating the RichSequence objects outside of the transaction - this can cause problems too.

There's some template code on Biojava.org which you can use as a shortcut to what you're trying to do:



On 24 Jan 2010, at 21:20, Deepak Sheoran wrote:

> org.hibernate.StaleStateException: Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1

Richard Holland, BSc MBCS
Operations and Delivery Director, Eagle Genomics Ltd
T: +44 (0)1223 654481 ext 3 | E: holland at eaglegenomics.com

More information about the Biojava-l mailing list