Now the transaction is rolling back in the case of an exception. But if
correct values are given, the transaction is not getting committed at the
end of the two insert statements. Is there any clue as to why this is
happening, and should I set something else for the commit to happen?


----- Original Message -----
From: "G Ramasubramani" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 12:29 PM
Subject: Re: Transactions


> If you are throwing SQLException, you need to get the ejbContext and do a
> setRollBackOnly on the context.
>
> Else you can catch the SQLException and throw a EJBException or some
exception
> which derives from EJBException.
>
> You need to obtain the connection through a Transactional data source and
set
> the connection to no auto- commit.
>
> Rama
> Pavan Venkata Tirunagari wrote:
>
> > 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".
>
> --
> thanks,
> Rama
>
> ********************************************************************
>
>      I've got plenty of common sense. I just choose to ignore it.
>                                                      - Calvin
> ********************************************************************
>
>
===========================================================================
> 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