Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

TransactionRequiredException: No transaction is currently active

594335Aug 27 2007 — edited Aug 31 2007
I'm using IBM's RAD 7.0 with TopLink Essentials - 2.0 (Build b41-beta2), so I'm running in a Java SE 1.5/Java EE 1.4 environment. The application is executing in IBM's WAS 6.1.

I try to do an insert into the database when I get a TransactionRequiredException (No transaction is currently active). The code looks like this:
getEntityManager().joinTransaction();
MessageBatch mb = new MessageBatch();
//Setting the object's values
...
getEntityManager().persist(mb);

If I remove the call to joinTransaction and instead call flush after the call to persist the same exception is thrown. Before calling the method containing this code I've started a transaction using the begin method on a javax.transaction.UserTransaction object.

Anyone know why the exception is thrown? Do I have to specify the transaction type in the persistence.xml file?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2007
Added on Aug 27 2007
1 comment
1,154 views