About Question enthuware.oce-ejbd.v6.2.468 :
Moderator: admin
About Question enthuware.oce-ejbd.v6.2.468 :
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
"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
Online
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.468 :
This has been fixed.
Thanks for your feedback!
Thanks for your feedback!
Online
Paul.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.468 :
That is weird because I distinctly remember fixing it. It has now definitely been fixed!Guest wrote:Still isn't fixed, afaics.
Paul.
-
- Posts: 55
- Joined: Thu Jan 03, 2013 7:51 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.468 :
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.
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.
Online
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.468 :
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.
HTH,
Paul.
-
- Posts: 55
- Joined: Thu Jan 03, 2013 7:51 am
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.468 :
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.
Who is online
Users browsing this forum: No registered users and 10 guests