Page 1 of 1

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

Posted: Sun May 03, 2015 6:57 pm
by himaiMinh
I think we should either setRollback(true) or use @ApplicationException(rollback=true) , so that the transaction is rolled back and the client and retry

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

Posted: Sun May 03, 2015 10:20 pm
by admin
Please read the problem statement carefully. It says, "...and retry in the same transaction."

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

Posted: Mon May 04, 2015 9:28 am
by himaiMinh
So, when a transaction is rollback, that transaction context is destroyed by the container ?

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

Posted: Mon May 04, 2015 9:43 am
by admin
Not sure what you mean by "destroyed". But what do you think rollback means?

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

Posted: Mon May 04, 2015 11:32 am
by himaiMinh
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?

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

Posted: Mon May 04, 2015 6:46 pm
by admin
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.