I turned on full debugging and set <property name="hibernate.jdbc.batch_size">0</property>
Now a huge output comes and I tried to cut out the relevant pieces:
at beginning:
Code:
[java] 65634 [main] DEBUG org.hibernate.engine.PersistenceContext - initializing non-lazy collections
[java] 65634 [main] DEBUG example.hibernateutils.HibernateUtilImport - Opening new Session for this thread.
[java] 65634 [main] DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 4558690471817216
[java] 65634 [main] DEBUG example.hibernateutils.HibernateUtilImport - Starting new database transaction in this thread.
[java] 65634 [main] DEBUG org.hibernate.transaction.JDBCTransaction - begin
[java] 65635 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - opening JDBC connection
[java] 65635 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - total checked-out connections: 0
[java] 65635 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - using pooled JDBC connection, pool size: 0
[java] 65635 [main] DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false
[java] 65635 [main] DEBUG org.hibernate.engine.Cascades - id unsaved-value strategy NULL
[java] 65635 [main] DEBUG org.hibernate.event.def.AbstractSaveEventListener - detached instance of: example.Prim
[java] 65635 [main] DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener - updating detached instance
[java] 65635 [main] DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener - updating [example.Prim#1aA1]
[java] 65635 [main] DEBUG org.hibernate.event.def.ReattachVisitor - collection dereferenced while transient [example.Prim.HasPrim#1aA1]
Code:
[java] 76247 [main] DEBUG org.hibernate.event.def.DefaultSaveOrUpdateEventListener - updating [example.Prim#32bD7]
[java] 76247 [main] DEBUG example.hibernateutils.HibernateUtilImport - Committing database transaction of this thread.
[java] 76247 [main] DEBUG org.hibernate.transaction.JDBCTransaction - commit
[java] 76247 [main] DEBUG org.hibernate.impl.SessionImpl - automatically flushing session
[java] 76247 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
[java] 76247 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
[java] 76280 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
[java] 76280 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
[java] 76288 [main] DEBUG org.hibernate.event.def.DefaultFlushEntityEventListener - Updating entity: [example.Prim#1aA1]
[java] 76288 [main] DEBUG org.hibernate.event.def.DefaultFlushEntityEventListener - Updating entity: [example.Prim#1aA10]
[java] 76288 [main] DEBUG org.hibernate.event.def.DefaultFlushEntityEventListener - Updating entity: [example.Prim#1aA11]
[java] 76288 [main] DEBUG org.hibernate.event.def.DefaultFlushEntityEventListener - Updating entity: [example.Prim#1aA12]
[java] 78260 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
[java] 78260 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
[java] 78260 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 insertions, 6231 updates, 0 deletions to 6231 objects
[java] 78260 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 6231 removals to 0 collections
[java] 78261 [main] DEBUG org.hibernate.pretty.Printer - example.Prim{name=null, id=10aE12, content=52.0, HasPrim=null, seq=xxxxx, temp=64.6}
[java] 78261 [main] DEBUG org.hibernate.pretty.Printer - example.Prim{name=null, id=3aH6, content=58.3, HasPrim=null, seq=xxxxx, temp=66.1}
at the end:
Code:
[java] 78266 [main] DEBUG org.hibernate.pretty.Printer - more......
[java] 78266 [main] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
[java] 78278 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Updating entity: [example.Prim#1aA1]
[java] 78278 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[java] 78278 [main] DEBUG org.hibernate.SQL - update primer set name=?, seq=?, temp=?, content=? where id=?
[java] Hibernate: update primer set name=?, seq=?, temp=?, content=? where id=?
[java] 78278 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
[java] 78278 [main] DEBUG org.hibernate.persister.entity.BasicEntityPersister - Dehydrating entity: [example.Prim#1aA1]
[java] 78279 [main] DEBUG org.hibernate.type.StringType - binding null to parameter: 1
[java] 78279 [main] DEBUG org.hibernate.type.StringType - binding 'xxxx' to parameter: 2
[java] 78279 [main] DEBUG org.hibernate.type.FloatType - binding '61.3' to parameter: 3
[java] 78279 [main] DEBUG org.hibernate.type.FloatType - binding '44.0' to parameter: 4
[java] 78279 [main] DEBUG org.hibernate.type.StringType - binding '1aA1' to parameter: 5
[java] 78310 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
[java] org.hibernate.HibernateException: Unexpected row count: 0 expected: 1
[java] at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:32)
[java] at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1995)
[java] at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1923)
[java] at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2163)
[java] at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
[java] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
[java] at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
[java] at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
[java] at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
[java] at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
[java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:675)
[java] at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
[java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
[java] at example.hibernateutils.HibernateUtilImport.commitTransaction(HibernateUtilImport.java:187)
[java] at example.dao.GenericServiceDAOImport.commit(GenericServiceDAOImport.java:46)
[java] at example.transformer.CloneTransformer.makePrimer(CloneTransformer.java:161)
[java] at example.Loader.<init>(Loader.java:29)
[java] at example.Main.main(Main.java:9)
[java] 78330 [main] DEBUG example.hibernateutils.HibernateUtilImport - Tyring to rollback database transaction of this thread.
[java] 78330 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rollback
[java] 78330 [main] DEBUG org.hibernate.jdbc.JDBCContext - before transaction completion
[java] 78330 [main] DEBUG org.hibernate.impl.SessionImpl - before transaction completion
[java] 78338 [main] DEBUG org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection
[java] 78339 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
[java] 78339 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
[java] 78350 [main] DEBUG example.hibernateutils.HibernateUtilImport - Closing Session of this thread.
[java] 78350 [main] DEBUG org.hibernate.impl.SessionImpl - closing session
[java] 78350 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - closing JDBC connection (open PreparedStatements: 1, globally: 1) (open ResultSets: 0, globally: 0)
[java] 78350 [main] DEBUG org.hibernate.connection.DriverManagerConnectionProvider - returning connection to pool, pool size: 1
[java] 78350 [main] DEBUG org.hibernate.jdbc.JDBCContext - after transaction completion
[java] 78350 [main] DEBUG org.hibernate.impl.SessionImpl - after transaction completion
[java] org.hibernate.HibernateException: Unexpected row count: 0 expected: 1
[java] at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:32)
[java] at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1995)
[java] at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1923)
[java] at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2163)
[java] at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
[java] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
[java] at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
[java] at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
[java] at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
[java] at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
[java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:675)
[java] at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:293)
[java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
[java] at example.hibernateutils.HibernateUtilImport.commitTransaction(HibernateUtilImport.java:187)
[java] at example.dao.GenericServiceDAOImport.commit(GenericServiceDAOImport.java:46)
[java] at example.transformer.CloneTransformer.makePrimer(CloneTransformer.java:161)
[java] at example.Loader.<init>(Loader.java:29)
[java] at example.Main.main(Main.java:9)
[java] Exception in thread "main" example.exceptions.InfrastructureException
[java] at example.hibernateutils.HibernateUtilImport.commitTransaction(HibernateUtilImport.java:192)
[java] at example.dao.GenericServiceDAOImport.commit(GenericServiceDAOImport.java:46)
[java] at example.transformer.CloneTransformer.makePrimer(CloneTransformer.java:161)
[java] at example.Loader.<init>(Loader.java:29)
[java] at example.Main.main(Main.java:9)