Posted By:
Siva_kumar
Posted On:
Saturday, June 22, 2002 11:56 PM
hi
i have found a solution for this.
In the callProcedure i have a code like
strRegisterOutParameter.equals("-1")).
If the above condition satisfies i should rollback the
records updated/inserted by the stored procedure.
Now what i do ...
if(strRegisterOutParameter.equals("-1"))
throw new TransactionRolledBackException();
the above code roll backs the records inserted by the
procedure.
Note:The callProcedure is a buisness method in
an stateless session bean which serves to execute
any stored procedure.
The transaction attribute i have setted for this method
is Requires which impiles Container Managed Transaction.
Earlier i tried throwing new Exception() but it did't
roll back instead it has commited the record.
why this happens?
Is the transaction layer is written in such a fashion
which expects only TransactionRolledBackException class
to thrown?
expecting ur cheerfull reply's
shiva