About Question enthuware.oce-ejbd.v6.2.412 :
Moderator: admin
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
The container starts a new one just before it invokes YBean.AsyncM method. It happens in container's code. Not in application code.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
I see, will this transaction cover any application code in this particular example?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
Yes, it will cover asycnM method.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
So transactional context will propagate into asycnM method and it will be new transaction as if RequiresNew transactional attribute specified on asyncM method?
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
Yes, REQUIRED behaves like REQUIRES_NEW in case of asynchronous calls.
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
Sorry for the off-topic. But I have another question about transaction propagation.
Excerpt from O'reilly EJB 3.1 book
Excerpt from O'reilly EJB 3.1 book
I think this is wrong, as transaction shall propagate from BMT to CMT. Could you please clarify? Thank you.If an EJB calls another EJB with a different transaction scope, the persistence context, regardless of whether it is extended, is not propagated.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.412 :
I am not sure in what context the book says that but you might want to talk to the author of the book about it.
It is true that Persistence context is propagated along with the transaction. But if two beans have different transaction attributes that require different transactions to be started, the persistence context cannot propagate.
You should also see Section 7.6.3 Persistence Context Propagation of JPA Specification.
HTH,
Paul
It is true that Persistence context is propagated along with the transaction. But if two beans have different transaction attributes that require different transactions to be started, the persistence context cannot propagate.
You should also see Section 7.6.3 Persistence Context Propagation of JPA Specification.
HTH,
Paul
If you like our products and services, please help us by posting your review here.
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Who is online
Users browsing this forum: No registered users and 28 guests