protected boolean closeResources() {
		try {
			if( conn != null && !conn.isClosed() ) {
				// This will roll the transaction back if there was a transaction active.
				if( inTransaction && conn.getAutoCommit() == false ) {
					logger.warn("Automatically rolling back the transaction.");
					conn.rollback();
				}
				conn.setAutoCommit(originalCommit);
				conn.close();
				return true;
			} else {
				return false;
			}
		} catch(Exception e) {
			logger.error("Close connection failed!",e);
			return false;
		}
	}