What do you mean you can't catch it?

try
{
// Do something
}
catch (javax.ejb.TransactionRolledbackLocalException e)
{
// Failed, there is a separate exception for remote.
}

Repeating the question does not provide any new information :-(

Regards,
Adrian

On Wed, 2003-10-29 at 15:52, Rafal Kedziorski wrote:
> At 15:55 29.10.2003, Adrian Brock wrote:
> >I'm not sure I understand your question.
> >A transaction rollback could happen at any time
> >due to a transient or permenant failure.
> 
> In the same trasaction I create new user entity bean, address entity bean 
> and user data entity bean [in the last mail -> public UserVO 
> createNewUser(UserVO userVO, User_DataVO user_dataVO, AddressVO 
> addressVO)]. In the same method I have to set the right user_data_id 
> foreign key in my user entity bean 
> [userLocal.setUser_data_id(user_dataLocal.getUser_data_id())]. But if I set 
> a wrong id [only for testing what happens -> userLocal.setUser_data_id(new 
> Long(20000))], which dosn't exist in the db, than this failed while:
> 
> java.sql.SQLException: General error,  message from server: "Cannot add or 
> update a child row: a foreign key constraint
> 
> I can't catch this and my servlet failed with:
> 
> HTTP ERROR: 500 Store failed; CausedByException is: General error, message
> from server: "Cannot add or update a child row: a foreign key constraint
> fails"; CausedByException is: Store failed; CausedByException is: General
> error, message from server: "Cannot add or update a child row: a foreign
> key constraint fails"
> 
> 
> Regards,
> Rafal
> 
> 
> >You can analyse the cause of the exception
> >by following the linked exceptions
> >in EJBException.or RemoteException.
> >
> >e.g. This code is used inside JBoss to discover
> >whether an execption is thrown due to an
> >application deadlock.
> >
> >    public static ApplicationDeadlockException isADE(Throwable t)
> >    {
> >       while (t!=null)
> >       {
> >          if (t instanceof ApplicationDeadlockException)
> >          {
> >             return (ApplicationDeadlockException)t;
> >          }
> >          else if (t instanceof RemoteException)
> >          {
> >             t = ((RemoteException)t).detail;
> >          }
> >          else if (t instanceof EJBException)
> >          {
> >             t = ((EJBException)t).getCausedByException();
> >          }
> >          else
> >          {
> >             return null;
> >          }
> >       }
> >       return null;
> >    }
> >
> >Regards,
> >Adrian
> 
> [...]
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?   SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
-- 
xxxxxxxxxxxxxxxxxxxxxxxx 
Adrian Brock
Director of Support
Back Office
JBoss Group, LLC 
xxxxxxxxxxxxxxxxxxxxxxxx 



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to