Example usage for javax.resource.cci Connection close

List of usage examples for javax.resource.cci Connection close

Introduction

In this page you can find the example usage for javax.resource.cci Connection close.

Prototype

public void close() throws ResourceException;

Source Link

Document

Initiates close of the connection handle at the application level.

Usage

From source file:org.springframework.jca.cci.connection.ConnectionFactoryUtils.java

/**
 * Actually close the given Connection, obtained from the given ConnectionFactory.
 * Same as {@link #releaseConnection}, but throwing the original ResourceException.
 * <p>Directly accessed by {@link TransactionAwareConnectionFactoryProxy}.
 * @param con the Connection to close if necessary
 * (if this is {@code null}, the call will be ignored)
 * @param cf the ConnectionFactory that the Connection was obtained from
 * (can be {@code null})//from  ww  w.j  av  a 2 s. com
 * @throws ResourceException if thrown by JCA CCI methods
 * @see #doGetConnection
 */
public static void doReleaseConnection(@Nullable Connection con, @Nullable ConnectionFactory cf)
        throws ResourceException {

    if (con == null || isConnectionTransactional(con, cf)) {
        return;
    }
    con.close();
}

From source file:org.springframework.jca.cci.connection.SingleConnectionFactory.java

/**
 * Close the given Connection./*ww  w. java  2s.c  o m*/
 * @param con the Connection to close
 */
protected void closeConnection(Connection con) {
    try {
        con.close();
    } catch (Throwable ex) {
        logger.warn("Could not close shared CCI Connection", ex);
    }
}