About Question enthuware.oce-ejbd.v6.2.450 :
Moderator: admin
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
About Question enthuware.oce-ejbd.v6.2.450 :
I think we should either setRollback(true) or use @ApplicationException(rollback=true) , so that the transaction is rolled back and the client and retry
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.450 :
Please read the problem statement carefully. It says, "...and retry in the same transaction."
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.450 :
So, when a transaction is rollback, that transaction context is destroyed by the container ?
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.450 :
Not sure what you mean by "destroyed". But what do you think rollback means?
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.450 :
Rollback means the unit of work in a transaction context is not completed as if the work has not never done.
So, in case of a rollback, the transaction context does not exist anymore?
So, in case of a rollback, the transaction context does not exist anymore?
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-ejbd.v6.2.450 :
It seems you are interpreting the phrase "in the same transaction" incorrectly. It is not talking about just a java transaction object. It is talking about the the fact that all the work needs to be done in the same database transaction. Once a transaction is rolled back, the client cannot commit anything using it. If it tries, it will get an exception. It will have to start a new transaction, which means the requirement of the question will not be satisfied.
Who is online
Users browsing this forum: No registered users and 5 guests