Where in your code do you call setRollbackOnly() ?
thanks Juha for your reply
I don't call setRollbackOnly() anywhere. wondering why should I need to explicitly do this way when I rely on container to handle the transaction. I specify my transaction parameter and I expect container to fulfill
as per EJB Spec, if there is any prob with the transaction I expect the container to roll back the txn right?
In my initial mail i've even included the jdbc way of handling and facing failure at that place.. let us leave that part and assume I do only in the EJB way.. i.e declarative transaction way.. I declare what kinda txn I need and I expect the container to handle the txn. I'm now wondering do i've to call setRollbackOnly() in this case
thanks in advance
The container can automatically rollback only in case of a runtime exception (as per the spec). With a checked exception you must explicitly tell the container that you want the transaction to be rolled back.