tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49831] Issue with closing XAConnections on MSSQL
Date Thu, 26 Aug 2010 18:21:44 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49831

--- Comment #1 from Daniel Mikusa <dmikusa@vmware.com> 2010-08-26 14:21:41 EDT ---
Thinking that the logic should be modified slightly...

    private void disconnect(boolean finalize) {
        if (isDiscarded()) {
            return;
        }
        setDiscarded(true);
        if (connection != null) {
            try {
                parent.disconnectEvent(this, finalize);
                connection.close();
                if (xaConnection != null) {
                    xaConnection.close();
                }
            }catch (Exception ignore) {
                if (log.isDebugEnabled()) {
                    log.debug("Unable to close underlying SQL
connection",ignore);
                }
            }
        }
        connection = null;
        xaConnection = null;
        lastConnected = -1;
        if (finalize) parent.finalize(this);
    }

Since "connection" is always set it seems like it should always be closed. 
Then if "xaConnection" is set, it should be closed as well.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message