-
1. Re: Transaction error handling
adrian.brock Oct 1, 2002 9:12 AM (in response to joeho)The short answer is don't throw Runtime or Remote
exceptions and use setRollbackOnly.
Regards,
Adrian -
2. Re: Transaction error handling
joeho Oct 1, 2002 12:34 PM (in response to joeho)But the problem when I use setRollback only, it will throw runtime exception e.g.
...
catch{
setRollbackonly();
throw AppException();
}
...
Runtime exception was thrown automatically and cannot reach "throw AppException()"
Thanks -
3. Re: Transaction error handling
adrian.brock Oct 1, 2002 2:56 PM (in response to joeho)What runtime exception is it throwing?
Are you sure AppException isn't a RuntimeException?
Regards,
Adrian -
4. Re: Transaction error handling
joeho Oct 2, 2002 5:48 AM (in response to joeho)I have tried this in session bean:
try{
...
//call entity bean here
...
}
catch
{
setRollbackOnly();
System.out.println("After roll back");
throw AppException();
}
...
I cannot get the message in log and nullpointer exception was received in caller session bean.
Thanks -
5. Re: Transaction error handling
joeho Oct 2, 2002 5:53 AM (in response to joeho)I have tried this in session bean:
try{
...
//call entity bean here
...
}
catch
{
setRollbackOnly();
System.out.println("After roll back");
throw AppException();
}
...
I cannot get the message in log and nullpointer exception was received in caller.
Thanks -
6. Re: Transaction error handling
adrian.brock Oct 2, 2002 8:37 AM (in response to joeho)That isn't even valid java :-)
Which version are you using, I know there
was some tidying up of the Exception handling in 3.0.1
If you still have a problem, can you post a simple
jar (with source) that illustrates it?
Regards,
Adrian -
7. Re: Transaction error handling
joeho Oct 3, 2002 11:35 AM (in response to joeho)I have solved the problem. It is because I cannot get the correct sessioncontext. Then error occurred at 'sessioncontext.setRollbackOnly()' and nullpointerException was thrown.
Warjort, thank you for your help!!