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
|