This should indeed rollback if you catch that SQLException and throw back
some form of application Exception like EJBException or anyother subclass of
RuntimeException.  The safer way however way to handle this is to vote for a
rollback with

_sessionContext.setRollbackOnly();

Dave Wolf
Internet Applications Division
Sybase


----- Original Message -----
From: "Pavan Venkata Tirunagari" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 06, 2000 9:29 PM
Subject: Transactions


> Hi
>
> I have a method setLoginDetails(username,password) which has the
transaction
> attribute of "Required".
> I am inserting username and password in two tables in my database.
> While the two insert statements are in the same transaction context as
both
> the operations are in the same method setLoginDetails().
>
> I am making the second insert statement to throw an sql exception by
> inserting the "data too long for th column"
> I expect the first insert operation to get rolled back.
> but It is not happening so.
>
> I am using stateless session bean with weblogic 5.1 and getting the
> connection from connection pool using the resource factory.
>
> Please suggest me.
>
> thanx in advance.
> Pavan
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to