-->
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: Hibernate in Long running JTA transaction
PostPosted: Sun Jul 24, 2005 4:25 pm 
Newbie

Joined: Sun Jul 24, 2005 4:17 pm
Posts: 7
Hello,

I have been searching the forums but could not get an answer for a problem that I must solve.

I have an remote application makes calls to jboss contained EJB3 Stateful session bean - Hibernate 3 - JTA - Mysql. When I need a transaction in a single call that is fine.

But at some point in my app, my client needs to insert thousands of inserts. JBOSS server is not on the LAN. So to avoid timeouts I decided to divide the call into batches of say 100.

But I couldn't find the correct hibernate settings to
- Start a transaction on the first call
- allow session to persist without a flush between calls to the bean
- commit the transaction in the last call.

I made the session and transaction variables class fields rather then local and started the session and transaction on the very first call and just to see rollbacked the transaction in the last call but all batches except the last batch was written to the database.

Desparately need help,
Thanks in advance,
Ceylan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 19, 2005 7:25 pm 
Newbie

Joined: Mon Oct 18, 2004 1:31 pm
Posts: 3
How about starting the transaction in your bean's ejbCreate() and committing it in the ejbRemove()? (EJB3 has annotations instead of these methods)

This would be a case when you manage your transactions manually.

Eli


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.