This content has been marked as final.
Show 4 replies
-
1. Re: Seam transactions
mrossix Oct 7, 2008 9:24 AM (in response to robbins)I have the same problem.
-
2. Re: Seam transactions
brachie Oct 9, 2008 10:29 AM (in response to robbins)Hi,
my approach would be to use manual flushmode for conversations and flush the changes manually to the DB whenever you want. So you can span one transaction over several requests.
Alexander
-
3. Re: Seam transactions
mrossix Oct 15, 2008 10:10 AM (in response to robbins)Thanks Alexander for your replay.
My problem is the opposite: two different transaction in the same method.
Look at this:MyBusinessObj{
public void persistMyEntity(){
// 1. persist a log information in a db table
// 2. persist myEntity
}
}I want to commit always the first information (also with the rollaback of the second).
Marco
-
4. Re: Seam transactions
brachie Oct 15, 2008 1:28 PM (in response to robbins)@Marco: Maybe you can try something like this:
MyBusinessObj{ ... public void persistMyEntity(){ Session session = sessionFactory.openSession(); org.hibernate.Transaction tx1 = session.beginTransaction(); // 1. persist a log information in a db table tx1.commit(); org.hibernate.Transaction tx2 = session.beginTransaction(); // 2. persist myEntity tx2.commit(); session.close(); }
I have not tried something like this but maybe it works...
Alexander