-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Limitation on number of saves in a transaction?
PostPosted: Tue Feb 07, 2006 6:39 pm 
Newbie

Joined: Mon Feb 06, 2006 5:14 pm
Posts: 3
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!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 07, 2006 9:15 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Can you post the nested exception too? There should be a caused-by SQLException after that one.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.