Force server to close current client subscription connection to the server
@param name Subscription name
@param database Database to use
549678
public void dropConnection(String name, String database) {
        RequestExecutor requestExecutor = _store.getRequestExecutor(ObjectUtils.firstNonNull(database, _store.getDatabase()));

        DropSubscriptionConnectionCommand command = new DropSubscriptionConnectionCommand(name);
        requestExecutor.execute(command);
    }
699226
public static void unregisterMbean(MBeanServer server, ObjectName name) {
        try {
            server.unregisterMBean(name);
        } catch(Exception e) {
            logger.error("Error unregistering mbean", e);
        }
    }
125103
public boolean unregisterMBean(String name) throws MBeanRegistrationException {

        synchronized (mBeanServer) {

            ObjectName toRemoveName;

            try {
                toRemoveName = new ObjectName(name);
            } catch (MalformedObjectNameException e) {
                return false; // bean with malformed can not be registered.
            }

            beansNames.remove(toRemoveName);

            try {
                mBeanServer.unregisterMBean(toRemoveName);
                return true;
            } catch (InstanceNotFoundException e) {
                return false;
            }

        }

    }
1220278
@EventHandler(field = "_resourceContext", eventSet = ResourceContext.ResourceEvents.class, eventName = "onRelease")
    public void onRelease() {

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Enter: onRelease()");
        }

        for (PreparedStatement ps : getResources()) {
            try {
                ps.close();
            } catch (SQLException sqe) {
            }
        }
        getResources().clear();

        if (_connection != null) {
            try {
                _connection.close();
            } catch (SQLException e) {
                throw new ControlException("SQL Exception while attempting to close database connection.", e);
            }
        }

        _connection = null;
        _connectionDataSource = null;
        _connectionDriver = null;
    }
526391
public Subscription register(final Object mBean, final String name){
        try {
            if (mbeanSupport.get()) {
                final ObjectName objectName = new ObjectName(name);
                server.registerMBean(mBean, objectName);
                return new Subscription() {
                    @Override
                    public void unsubscribe() {
                        try {
                            server.unregisterMBean(objectName);
                        } catch (JMException e) {
                            throw new RuntimeException("Can not unsubscribe!", e);
                        }
                    }
                };
            } else {
                return new Subscription() {
                    @Override
                    public void unsubscribe() {
                    }
                };
            }
        } catch (Exception e) {
            throw new RuntimeException("Can not register MBean!", e);
        }
    }
1101050
@Override
    public void close() throws SQLException
    {
        try
        {
            isClosed = true;
            JDBC4ClientConnectionPool.dispose(NativeConnection);
        }
        catch(Exception x)
        {
            throw SQLError.get(x);
        }
    }
604597
static void closeQuietly(Connection connection) {
        try {
            if (connection != null && !connection.isClosed()) {
                connection.close();
                log.debug("closed {}", connection);
            }
        } catch (SQLException e) {
            log.debug(e.getMessage(), e);
        } catch (RuntimeException e) {
            log.debug(e.getMessage(), e);
        }
    }
138761
public static void shutdown()
        throws StartupException
    {
        final Context compCtx;
        try {
            final InitialContext context = new InitialContext();
            compCtx = (javax.naming.Context) context.lookup("java:comp");
        } catch (final NamingException e) {
            throw new StartupException("Could not initialize JNDI", e);
        }
        try {
            Util.unbind(compCtx, "env/" + INamingBinds.RESOURCE_DATASOURCE);
            Util.unbind(compCtx, "env/" + INamingBinds.RESOURCE_DBTYPE);
            Util.unbind(compCtx, "env/" + INamingBinds.RESOURCE_CONFIGPROPERTIES);
            Util.unbind(compCtx, "env/" + INamingBinds.RESOURCE_TRANSMANAG);
        } catch (final NamingException e) {
            throw new StartupException("unbind of the database connection failed", e);
        }
    }
1108028
public static void drop(DB db, String tableName) {
    DBSetup.drop(CallInfo.create(), db, tableName);
  }
553684
function dropDatabase (db, fn) {
  db.connection.db.executeDbCommand({
    dropDatabase: 1
  }, function(err, result) {
    db.disconnect()
    fn && fn(err, result)
  })
}
1008511
def close_connection(self, connection, force=False):
        """"""
        if force:
            try:
                connection.close()
            except self.operational_exceptions:
                self.config.logger.error('ConnectionFactory - failed closing')
            for name, conn in self.pool.iteritems():
                if conn is connection:
                    break
            del self.pool[name]
        else:
            pass
542462
function destroyDatabase(name, cb) {
  if(name === user_dbname)
    throw new Error('We never ever delete that database.')
  nano().db.destroy(name, function(err) {
    if(err && err.status_code !== 404) return cb(err)
    cb(null, err ? false : true)
  })
}
1077041
def drop_connection(self, name, database=None):
        
        request_executor = self._store.get_request_executor(database)
        command = DropSubscriptionConnectionCommand(name)
        request_executor.execute(command)
171382
public static void registerMbean(MBeanServer server, ModelMBean mbean, ObjectName name) {
        try {
            synchronized(LOCK) {
                if(server.isRegistered(name))
                    JmxUtils.unregisterMbean(server, name);
                server.registerMBean(mbean, name);
            }
        } catch(Exception e) {
            logger.error("Error registering mbean:", e);
        }
    }
867729
public static boolean registerJdbcDataSource(String name, DataSource dataSource) {
        return jdbcDataSources.putIfAbsent(name, dataSource) == null;
    }
730581
void release(DatasourceConnection dc) {
	if (dc != null) {

	    try {
		dc.getConnection().commit();
		dc.getConnection().setAutoCommit(true);
		dc.getConnection().setTransactionIsolation(Connection.TRANSACTION_NONE);
	    }
	    catch (SQLException e) {}

	    getManager().releaseConnection(ThreadLocalPageContext.get(), dc);
	}
    }
321663
public static final void serverShortName(String name)
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "serverShortName", name);

        _serverShortName = name;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "serverShortName");
    }