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

Moderator: admin

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

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

Post by gurpreet_asrgndu »

the explanation should be expanded since it may be possible that clients transaction context is propagated to message driven bean. as written in the specs this may be possible for some messaging listener interface and corresponding messaging provider. using "never' is a bit too strong a word

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

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

Post by admin »

Could you please mention the section where the specification talks about that because I couldn't find it?

thank you,
Paul
If you like our products and services, please help us by posting your review here.

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

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

Post by gurpreet_asrgndu »

admin wrote:Could you please mention the section where the specification talks about that because I couldn't find it?

thank you,
Paul
well my bad paul, i mistook transaction context for security context which can propagate from caller to MDB. here is the relevant section from the specs

5.4.13 Security Context of Message-Driven Bean Methods

gonzo08
Posts: 3
Joined: Sun Dec 29, 2013 1:44 pm
Contact:

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

Post by gonzo08 »

Hi,
I'm just wondering about the difference of RequiresNew and Required within this topic...
Why I cannot use RequiresNew?
This explanation confute neither my feeling:
"Remember that Message Driven beans are not directly called by any user or client. So there can never be an existing transaction when the bean's method is called."
1) So if no tx from client side?
- required: creates a new one
- requiresNew: creates a new one
2) if it has a tx:
- required: use it
- requiresNew: creates a new one
But in case of MDBs, 2) can never happen, so if I consider only 1),...same approach...but why RequiresNew not included in the possible answers?
Thanks,
gonzo

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

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

Post by admin »

As per Section 13.3.7, page 359 of the EJB 3.1 specification:
For a message-driven bean’s message listener methods (or interface), only the REQUIRED and NOT_SUPPORTED TransactionAttribute values may be used.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.

gonzo08
Posts: 3
Joined: Sun Dec 29, 2013 1:44 pm
Contact:

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

Post by gonzo08 »

Hi Paul,
yes, based on the spec, correct answer.
But my original problem was to find the reason why RequiresNew cannot be used here?
Based on my explanation with point 1) and 2) I still cannot see the answer. :(
(I want to understand why the spec uses Required and RequiresNew does not)
Thank you,
gonzo

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

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

Post by admin »

One can only guess why the expert group for the specification did not allow RequriesNew. The most logical reason is already given in the explanation i.e. RequiresNew doesn't make sense in case of MDB because there is no existing transaction.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

gonzo08
Posts: 3
Joined: Sun Dec 29, 2013 1:44 pm
Contact:

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

Post by gonzo08 »

admin wrote:"RequiresNew doesn't make sense in case of MDB because there is no existing transaction"
yes, and from this point of view Required and RequiresNew are the same, that's why I'm asking :)
In my explanation: 2) is ignored, and on the remaining 1) level, the operation mode of 2 transaction types are the same :)

Sorry for my incomprehension!

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

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

Post by ramy6_1 »

Hello ,

I also need to understand why RequiresNew is not provided by spec in this case ?
RequiresNew will create a new transaction anyway so it has the same effect of using Required.

We know Spec prevents this , but we need to know why.
Please explain.

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

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

Post by admin »

No one can really answer this for sure except the spec writers :(
You may send them an email and ask.
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests