[jboss-user] [EJB 3.0] - Re: Create timer -
rruppel
do-not-reply at jboss.com
Thu Mar 27 15:46:14 EDT 2008
hi all,
i know this thread is old, but I have an doubt about this subject
I have the same problem, and both suggestions worked
1. editing the ejb-deployer to use the same datasource for the timer
2. editing the jbossjta-properties.xml to allow the two resources at same transaction
ok, but I think it would be even better that I could just create two transactions:
first I persist the information I want... I commit and then I start a new transaction to only create the Timer...
i tryed to do this inside a Stateless bean, just adding TransactionAttribute of type REQUIRES_NEW to the method
but this didnt worked.... someone can explain and please give a solution
thanks in advance
|
| public void firstMethod(){
|
| entyManager.persist(something);
| schedule();
| }
|
|
| @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
| public void schedule(){
| timerService.createTimer(0, "myTimer");
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4139454#4139454
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4139454
More information about the jboss-user
mailing list