示例#1
0
 @Override
 public void close() throws DatabaseException {
   try {
     DatabaseConnection connection = getConnection();
     if (connection != null) {
       connection.close();
     }
   } catch (DatabaseException e) {
     throw new DatabaseException(e);
   }
 }
示例#2
0
  @Override
  public void close() throws DatabaseException {
    DatabaseConnection connection = getConnection();
    if (connection != null) {
      if (previousAutoCommit != null) {
        try {
          connection.setAutoCommit(previousAutoCommit);
        } catch (DatabaseException e) {
          LogFactory.getLogger()
              .warning("Failed to restore the auto commit to " + previousAutoCommit);

          throw e;
        }
      }
      connection.close();
    }
    ExecutorService.getInstance().clearExecutor(this);
  }