// closes and re-opens to reset a database connection int ManagedDatasource::reset(ExceptionSink *xsink) { AutoLocker al(&ds_lock); if (closeUnlocked(xsink)) return -1; // open the connection return Datasource::open(xsink); }
void ManagedDatasource::destructor(ExceptionSink *xsink) { AutoLocker al(&ds_lock); if (tid == gettid() || tid == -1) // closeUnlocked will throw an exception if a transaction is in progress (and release the transaction lock if held) closeUnlocked(xsink); else xsink->raiseException("DATASOURCE-ERROR", "%s:%s@%s: TID %d deleted Datasource while TID %d is holding the transaction lock", getDriverName(), getUsernameStr().c_str(), getDBNameStr().c_str(), gettid(), tid); }
void SSH2Channel::destructor() { // close channel and deregister from parent AutoLocker al(parent->m); if (channel) { parent->channelDeletedUnlocked(this); closeUnlocked(); } }
int ManagedDatasource::close(ExceptionSink *xsink) { AutoLocker al(&ds_lock); return closeUnlocked(xsink); }