For example, If I call EJB method from web context. EJB has Container Managed Transaction(CMT) with Local Bean and its method has required_new transactional attribute. What does client gets if EJB method throws System Exception? I mean, transaction is rolled back. So, Does client gets EJBTransactionRolledBackException or simply EJBException?
Thanks in advance.
In CMT If I set Requires_New transactional attribute and throws system exception then client gets which exception?
Moderator: admin
-
- Posts: 2
- Joined: Tue Jul 16, 2013 4:04 am
- Contact:
-
- Site Admin
- Posts: 10055
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: In CMT If I set Requires_New transactional attribute and throws system exception then client gets which exception?
Since the bean starts a new transaction, the client's transaction will not be rolled back. The client gets EJBException. Check out section 14.3.1 table 15.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Tue Jul 16, 2013 4:04 am
- Contact:
Re: In CMT If I set Requires_New transactional attribute and throws system exception then client gets which exception?
Thank you for your answer.
I have one more question. Is there any way to know status of EJB's transaction in above mentioned case?
I have one more question. Is there any way to know status of EJB's transaction in above mentioned case?
-
- Posts: 26
- Joined: Fri Jul 06, 2012 1:08 am
- Location: Poland
- Contact:
Re: In CMT If I set Requires_New transactional attribute and throws system exception then client gets which exception?
Yes, you should call getRollbackOnly method on SessionContext object if it's CMT.
Who is online
Users browsing this forum: No registered users and 29 guests