Hi,
I did the same thing.I'm catching the SQLException and throwing the EJBException
and I made setAutoCommit is false.Transactio is rolled back
when any insert satement has "too long value".Tha is OK.
but I'm giving proper data to the insert satements at tha time also data is not
committed.data was not inserted in to the tables.commit is not happening.

Please suggest me.

Hari

G Ramasubramani wrote:

> 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