Java Code Examples for javax.resource.cci.Connection#close()

The following examples show how to use javax.resource.cci.Connection#close() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SingleConnectionFactory.java    From spring-analysis-note with MIT License 5 votes vote down vote up
/**
 * Close the given Connection.
 * @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);
	}
}
 
Example 2
Source File: SingleConnectionFactory.java    From java-technology-stack with MIT License 5 votes vote down vote up
/**
 * Close the given Connection.
 * @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);
	}
}
 
Example 3
Source File: SingleConnectionFactory.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Close the given Connection.
 * @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);
	}
}
 
Example 4
Source File: SingleConnectionFactory.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Close the given Connection.
 * @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);
	}
}
 
Example 5
Source File: ConnectionFactoryUtils.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * 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})
 * @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();
}
 
Example 6
Source File: ConnectionFactoryUtils.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * 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})
 * @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();
}
 
Example 7
Source File: ConnectionFactoryUtils.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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})
 * @throws ResourceException if thrown by JCA CCI methods
 * @see #doGetConnection
 */
public static void doReleaseConnection(Connection con, ConnectionFactory cf) throws ResourceException {
	if (con == null || isConnectionTransactional(con, cf)) {
		return;
	}
	con.close();
}
 
Example 8
Source File: ConnectionFactoryUtils.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * 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})
 * @throws ResourceException if thrown by JCA CCI methods
 * @see #doGetConnection
 */
public static void doReleaseConnection(Connection con, ConnectionFactory cf) throws ResourceException {
	if (con == null || isConnectionTransactional(con, cf)) {
		return;
	}
	con.close();
}