Page 1 of 1
About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Wed Aug 24, 2011 2:56 pm
by jszczepankiewicz
fourth option:
"If an instance of a message-driven bean with container-managed transaction demarcation should use the getUserTransaction method of the EJBContext interface."
is not gramatically correct
Re: About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Thu Aug 25, 2011 12:13 pm
by admin
This has been fixed.
Thanks for your feedback!
Re: About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Fri Oct 12, 2012 2:08 pm
by Guest
Still isn't fixed, afaics.
Re: About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Sat Oct 13, 2012 5:24 pm
by admin
Guest wrote:Still isn't fixed, afaics.
That is weird because I distinctly remember fixing it. It has now definitely been fixed!
Paul.
Re: About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Sun Jul 14, 2013 3:07 pm
by gurpreet_asrgndu
the explanation of the first option(which is incorrect) shows an example as below :
public void someMethod(...) {
con1 = database1.getConnection(); stmt1 = con1.createStatement();
con2 = database2.getConnection(); stmt2 = con2.createStatement();
ut.begin();
// Do some updates to both con1 and con2. The container
// automatically enlists con1 and con2 with the transaction.
ut.commit();
con1.close(); con2.close();
}
in my opinion the code to fetch database connection viz. con1 = database1.getConnection();con2 = database2.getConnection(); should be between ut.begin() and commit(). then only can container automatically enlist the transactional resources in the transaction.
Re: About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Sun Jul 14, 2013 3:56 pm
by admin
That is not because you can do multiple transactions using the same connection. You don't have to open and close connection after each transaction.
HTH,
Paul.
Re: About Question enthuware.oce-ejbd.v6.2.468 :
Posted: Sun Jul 14, 2013 4:43 pm
by gurpreet_asrgndu
admin wrote:That is not because you can do multiple transactions using the same connection. You don't have to open and close connection after each transaction.
HTH,
Paul.
yeah Paul you are right. i thought i read somewhere that for resource enlistment , they should occur inside the transaction. i checked the spec and it says that in BMT the container automatically enlists the resource manager which are used between begin() and commit() or rollback method.