About Question enthuware.oce-jpad.v6.2.513 :
Moderator: admin
-
- Posts: 5
- Joined: Thu Oct 17, 2013 9:26 pm
- Contact:
About Question enthuware.oce-jpad.v6.2.513 :
RESOURCE_LOCAL transaction-type can be only used in Application-managed Entity Manager? In this question, the Statefull Session Bean should use Application-managed Entity Manager?
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.513 :
I am not sure I understand your question. In this question, em could be injected also. It doesn't have to be RESOURCE_LOCAL.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 3
- Joined: Sun Nov 30, 2014 5:00 am
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.513 :
em.getTransaction() will throw IllegalStateException if invoked on a JTA entity manager.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.513 :
Code: Select all
1. EntityTransaction et = em.getTransaction();
2. et.setRollbackOnly();
-
- Site Admin
- Posts: 10053
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.513 :
What if processAccount is the first method to be invoked. In the given code, there is no call to begin. Thus the transaction is not active at this point and therefore a call to setRollBackOnly will throw IllegalStateException.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.513 :
I see now, transaction is not active because begin has not been called, thank you.
Who is online
Users browsing this forum: No registered users and 29 guests