public void pop() {
    try {
      ISrvSmartTran trn = SrvApiAlgs2.getIServerTran();

      trn.close();

      IPooledConnection pool = ApiStack.getApi().getIntfImplementor(IPooledConnection.class);
      Connection con = ApiStack.getApi().getIntfImplementor(Connection.class);
      try {
        pool.returnConnection(con);
      } catch (Throwable t) {
        ApiAlgs.getLog(this).error("Error returning connection", t);
      }

    } finally {
      ApiStack.popApi();
    }
  }
 public void run() {
   QSyncTaskResult result;
   try {
     m_syncer.init();
     boolean bCompleted = exec();
     result =
         new QSyncTaskResult(
             m_qid,
             m_syncerId,
             bCompleted ? QSyncTaskStatus.SYNCED : QSyncTaskStatus.EXEC_TIMEOUT,
             null);
   } catch (Exception e) {
     ApiAlgs.getLog(this).error("Sync task error", e);
     m_syncer.finit(e);
     result = new QSyncTaskResult(m_qid, m_syncerId, m_errorStatus, e);
   }
   m_syncMan.onTaskCompleted(result);
   SrvApiAlgs2.getIServerTran().commit();
 }
 private TQSyncQueues.BL queueBL() {
   return SrvApiAlgs2.getIServerTran().instantiateBL(TQSyncQueues.BL.class);
 }