Ejemplo n.º 1
0
// 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);
}
Ejemplo n.º 2
0
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);
}
Ejemplo n.º 3
0
void SSH2Channel::destructor() {
   // close channel and deregister from parent
   AutoLocker al(parent->m);
   if (channel) {
      parent->channelDeletedUnlocked(this);
      closeUnlocked();
   }
}
Ejemplo n.º 4
0
int ManagedDatasource::close(ExceptionSink *xsink) {
   AutoLocker al(&ds_lock);
   return closeUnlocked(xsink);
}