The container does not actually close the connection.  Your code may say
conn.close() but the container is aware and will not commit until your
transaction is complete.  That is why you need a JTS driver.

--tinou.com

----- Original Message -----
From: "krithikav" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 20, 2001 8:59 AM
Subject: [EJB-INT] Doubt in CMT


> Hi,
> I have a doubt in the basic concept of Container Managed Transaction.
> In one of the business method(with transaction attribute: TX_REQUIRED) of
my
> EJB, I
> do the following:
>
> open a connection to the database
> try{
>         update table A
>         update table B
> }
> catch (Exception e)
> {
>         close the connection
>         throw a remote exception
> }
> close the connection.
>
> Now if the update to the table B fails and it results in an exception and
> then I close the connection and throw a remote exception to the container,
> how will the container rollback the entire transaction when the connection
> is closed and it is no longer available for the container.
>
> Regards,
> Krithika
>
>
===========================================================================
> 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