About Question enthuware.oce-ejbd.v6.2.468 :

Moderator: admin

Post Reply
jszczepankiewicz

About Question enthuware.oce-ejbd.v6.2.468 :

Post 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

Online
admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.468 :

Post by admin »

This has been fixed.

Thanks for your feedback!

Guest

Re: About Question enthuware.oce-ejbd.v6.2.468 :

Post by Guest »

Still isn't fixed, afaics.

Online
admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.468 :

Post 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.

gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.468 :

Post 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.

Online
admin
Site Admin
Posts: 10384
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.468 :

Post 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.

gurpreet_asrgndu
Posts: 55
Joined: Thu Jan 03, 2013 7:51 am
Contact:

Re: About Question enthuware.oce-ejbd.v6.2.468 :

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests