I have a very simple bean mapped to a single table. I wrote a small program to pre-load the table with a bunch of entries for further testing.
The "load" code is structured as:
Code:
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
session.save( new Item( ... bunch-o-params ... ) );
session.save( new Item( ... bunch-o-params ... ) );
session.save( new Item( ... bunch-o-params ... ) );
...
session.getTransaction().commit();
Everything is fine if the number of save() calls is 15 or less. If I attempt a 16th save within the transaction, I get:
Code:
ERROR JDBCExceptionReporter Batch entry 0 insert into bddb_titles ... was aborted.
ERROR AbstractFlushingEventListener Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:230)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:140)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:296)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1009)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:356)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
The first 15 items are correctly loaded into the DB.
Environment: Win XP, Hibernate 3, PostgreSQL, JDK 1.5
Am I running up against some limitation of the transaction? The PostgreSQL driver? Some buffer overflow?
Or am I just doing something incredibly stupid?
Any ideas would be appreciated.
thanks!