MCPcopy Create free account
hub / github.com/apache/tomcat / close

Method close

java/org/apache/catalina/session/DataSourceStore.java:611–633  ·  view source on GitHub ↗

Close the specified database connection. @param dbConnection The connection to be closed

(Connection dbConnection)

Source from the content-addressed store, hash-verified

609 * @param dbConnection The connection to be closed
610 */
611 protected void close(Connection dbConnection) {
612
613 // Do nothing if the database connection is already closed
614 if (dbConnection == null) {
615 return;
616 }
617
618 // Commit if autoCommit is false
619 try {
620 if (!dbConnection.getAutoCommit()) {
621 dbConnection.commit();
622 }
623 } catch (SQLException e) {
624 manager.getContext().getLogger().error(sm.getString("dataSourceStore.commitSQLException"), e);
625 }
626
627 // Close this database connection, and log any errors
628 try {
629 dbConnection.close();
630 } catch (SQLException e) {
631 manager.getContext().getLogger().error(sm.getString("dataSourceStore.close"), e);
632 }
633 }
634
635 /**
636 * Release the connection, if it is associated with a connection pool.

Callers 1

releaseMethod · 0.95

Calls 7

getAutoCommitMethod · 0.65
commitMethod · 0.65
errorMethod · 0.65
getLoggerMethod · 0.65
getContextMethod · 0.65
getStringMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected