Out of the office (was Re: Question regarding close and commit with UserTransaction)

Jim Gish <[email protected]> Mon, 6 Jan 2003 09:46:09 -0500
Newsgroups gmane.comp.java.sun.connector
Message-ID <[email protected]>
At 01:00 AM 12/25/2002, you wrote:
>Hi,
>I am running a test case with two app servers and am
>seeing different behaviors.
>
>What I am doing:
>- I use a stateless session bean with bean demarcated transactions.
>- I do the following in a method:
>   method {
>    UserTransaction utx = null;
>    Connection con1 = null;
>    Connection con2 = null;
>    try {
>        utx = ctx.getUserTransaction();
>        utx.begin();
>       con1 = getXAConnection1();
>       //do stuff using con1
>       con2 = getXAConnection2();
>        //do stuff using con2
>       utx.commit();
>    } catch (Exception e) {
>        utx.rollback();
>       //error handling
>    } finally {
>        if (con1 != null)
>            con1.close;
>        if (con2 != null)
>            con2.close();
>   }
>  }
>
>In one app server there does not seem to be any problem in what I do.
>In another app server there is a problem if I close the connection after
>utx.commit().  It throws IllegalStateException when it reaches the
>con.close()
>part.
>So, what is the right behavior?
>
>Thanks ,
>Gurdev
>
>===========================================================================
>To unsubscribe, send email to [email protected] and include in the body
>of the message "signoff CONNECTOR-INTEREST".  For general help, send email to
>[email protected] and include in the body of the message "help".
>
I'll be out of the office starting Friday, Dec. 21.  I will return on
Monday January 6, 2003 and will read & respond to your mail upon my return.

Thanks,
         Jim

Jim Gish
Java Connector Architecture Team Lead
bea Systems, Inc                             phone:
781-993-7309
4 Van de Graaff Drive                        fax:       781-993-7606
Burlington. MA 01803                         e-mail: [email protected]