Hi,

Here is the code:

    public Integer ejbCreate (ContactInformation info,int referenceId)
throws CreateException {

        // set the instance data
        this.info = info;

        IndividualDAO IDAO = new IndividualDAO();

        IDAO.setInfo(info);
        try
        {
                dbConnection = getDBConnection();
                individualId = IDAO.create(dbConnection,referenceId,context);
                         return (individualId);
        }
        catch (java.sql.SQLException se)
        {
        System.out.println("Rolling back");
           throw new EJBException ("SQL Exception in create:" + se);
       }
        finally
        {
        try
        {
               dbConnection.close();
         }
        catch (SQLException se)
        {
          throw new EJBException("SQL Exception in create:" + se);
        }
        }


    }







On Fri, 19 January 2001, G Ramasubramani wrote:

>
> Pooja,
>
>         Could you post the relevant part of the code in ejbCreate which catches  the 
>SQL exception and then rethrows a EJB Exception? Also the deployment files for the 
>entity?
>
> Rama
>
> Pooja Keswani wrote:
>
> > Hi Reddy,
> >  I would like to give u more information about the problem so that it will be 
>easier for u to understand it exactly. i m using entity bean  which has container 
>managed transcation. This ejb has one helper class(DAO) for database transactions . 
>ejb calls DAO's create method in its ejbcreate method. now DAO's create method calls 
>one more method named insertIndividual() which actually updates the D/B ie it 
>executes 3 insert queries. Now if SQL exception occures in this method, it throws it 
>to create of DAO and then to ejbcreate of ejb which will throw the EJBexception  
>causing rollback . but it is not doing this way. Actually it says transaction rolled 
>back. but doesn't undo changes in D/B.
> > what must be happening?
> > I will appreciate ur reply.
> > thanks
>
> ********************************************************************
>
>      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".


Chequemail.com - a free web based e-mail service that also pays!!!
http://www.chequemail.com

===========================================================================
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