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

Moderator: admin

Post Reply
himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Please read the problem statement carefully. It says, "...and retry in the same transaction."

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post by himaiMinh »

So, when a transaction is rollback, that transaction context is destroyed by the container ?

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Not sure what you mean by "destroyed". But what do you think rollback means?

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

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

Post 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?

admin
Site Admin
Posts: 10386
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests