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: http://www.biojava.org/wiki/BioJava:BioJavaXDocs#BioEntryDB_and_RichSequenceDB_convenience_wrappers cheers, Richard 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: [email protected] http://www.eaglegenomics.com/ _______________________________________________ Biojava-l mailing list - [email protected] http://lists.open-bio.org/mailman/listinfo/biojava-l
