Page 1 of 1
About Question enthuware.oce-jpad.v6.2.513 :
Posted: Mon Oct 28, 2013 7:52 pm
by ericrlessa
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?
Re: About Question enthuware.oce-jpad.v6.2.513 :
Posted: Sat Nov 02, 2013 7:43 am
by admin
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.
Re: About Question enthuware.oce-jpad.v6.2.513 :
Posted: Sun Nov 30, 2014 5:08 am
by ioan.b
em.getTransaction() will throw IllegalStateException if invoked on a JTA entity manager.
Re: About Question enthuware.oce-jpad.v6.2.513 :
Posted: Sat Dec 24, 2016 5:59 pm
by johnlong
Code: Select all
1. EntityTransaction et = em.getTransaction();
2. et.setRollbackOnly();
Could you please describe case(s) in which et instance would be non-active transaction on line 2?
Re: About Question enthuware.oce-jpad.v6.2.513 :
Posted: Sun Dec 25, 2016 12:22 pm
by admin
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.
Re: About Question enthuware.oce-jpad.v6.2.513 :
Posted: Sun Dec 25, 2016 6:20 pm
by johnlong
I see now, transaction is not active because begin has not been called, thank you.