Page 1 of 1

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

Posted: Thu Jul 18, 2013 7:32 am
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

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

Posted: Sat Jul 20, 2013 1:18 pm
by admin
Could you please mention the section where the specification talks about that because I couldn't find it?

thank you,
Paul

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

Posted: Sun Jul 21, 2013 8:15 am
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

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

Posted: Sun Dec 29, 2013 1:56 pm
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

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

Posted: Tue Dec 31, 2013 8:48 pm
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.

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

Posted: Wed Jan 01, 2014 2:37 am
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

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

Posted: Wed Jan 01, 2014 3:12 am
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.

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

Posted: Wed Jan 01, 2014 6:34 am
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!

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

Posted: Sun Dec 14, 2014 5:07 am
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.

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

Posted: Sun Dec 14, 2014 6:28 am
by admin
No one can really answer this for sure except the spec writers :(
You may send them an email and ask.
Paul.