}
}
+ public boolean isClosed() throws MSqlConnectionFailureException {
+ try {
+ return this.getConnectionReference().isClosed();
+ }
+ catch (SQLException exception) {
+ throw new MSqlConnectionFailureException("Could not determine the state.", exception);
+ }
+ }
+
protected void finalize() {
try {
this.close();
return connection;
}
- public synchronized void pushConnection(MSqlConnection connection) {
+ public synchronized void pushConnection(MSqlConnection connection) throws MSqlConnectionFailureException {
if (null == connection) {
throw new IllegalArgumentException("Invalid 'connection': null.");
}
+ else if (connection.isClosed()) {
+ throw new IllegalArgumentException("Invalid 'connection': closed.");
+ }
//
LinkedList<MSqlConnection> connectionPool = this.getConnectionPool();
if (this.getMaximumSize() >= connectionPool.size()) {