I am trying to create a Quartz job that saves some data to my database. The
quartz process is working correctly and my jobs runs, I can just never get
the data committed to my database.

In my job, I call an EJB3 that accesses my EntityManager.  The method in my
EJB is marked with @TransactionAttribute(TransactionAttributeType.REQUIRED)
and I can access the UserTransaction by injecting it into my bean by @In
protected UserTransaction ut;

When I call my method, the UserTransaction says that it is active. I then
persist my object to the EntityManager. When the quartz job is done, the new
data was never committed to the database. So I tried to manually commit the
usertransaction at the end of my method by using ut.commit(), but then I get
an error:
"Can't commit outside of a transaction.  Either the UserTransaction.begin()
is missing or the transaction has already been committed or rolled back."

So how can I manage transactions in an EJB3 outside of a webpage request?
View this message in context: 
Sent from the Resin mailing list archive at Nabble.com.

resin-interest mailing list

Reply via email to