db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: Rollback is not executed only for XA sessions after the socket is closed.
Date Mon, 08 Jan 2007 15:55:17 GMT
Julius Stroffek wrote:
> Hi All,
> I work on the DERBY-2220 and I found out that the function close of 
> org.apache.derby.impl.drda.Database class contains the following code
>     if (! forXA)
>     {
>         conn.rollback();
>     }
>     conn.close();
> Does anybody know the reason for doing this? I can not find out any. In 
> my opinion it makes no sense not to execute rollback if the socket is 
> closed. There might be some special case for doing this but there are 
> lot of cases when it makes no sense - like application crash.

With an XA transaction the connection (the logical connection as seen by 
the application) can be closed and the transaction remain active. The 
transaction's lifecycle is driven by the XAResource interface, not the 
Connection interface. I'm not sure how that ties into the above code, 
but it is the normal case.

Is it possible to re-word the summary of DERBY-2220?

"Transaction executed throught XAResource will held locks forever (until 
commit is executed) and also after the application terminates."

I think that summary gives the impression of a much bigger problem than 
really exists.


View raw message