Hi Pankaj,
Rollback is not automatic if an application exception is thrown, this only happens for runtime (system) exceptions. You can mark the transaction for rollback by calling SessionContext.setRollbackOnly(). This will let the container know that the transaction should be rolled back. To do this, you need to inject a SessionContext in your bean class:
Code:
@Resource
private SessionContext sctx;
Then call
Code:
sctx.setRollbackOnly()
in your exception handler.
The stack trace for the exception should tell you which type of exception is begin thrown. Unless it is a subclass of RuntimeException, or RemoteException, then the rollback will not happen automatically.
Hope that helps,
Kate.