If you r using the same connection for both the methods, then u can
rollback. I wud suggest you to do sth like this
Main method()
{
Open ur connection
Method1(pass connection object);
Method2(pass connection object);
Rollback or commit the connection based on ur exceptions etc.
Close the connection
}
I guess the above shud be doable.
-Ravi
> -----Original Message-----
> From: Navjot Singh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 12, 2003 11:14 AM
> To: Struts Users Mailing List
> Subject: [OT] Transaction Safe Java Code
>
>
> Hi List,
>
> I have 2 methods that i am calling in same sequence.
>
> + txnMethod1()
> + txnMethod2()
>
> I wish either both of them get _executed_ or none of them.
>
> Can i rollback the state to what was before method1's
> _execution_ if method2 fails?
>
> Is it possible or i should start thinking simple?
>
> ---------------
> regards
> Navjot Singh
> Net4India Ltd.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]