Logs actions to the database, and preps for auto-close if specified

@param  {string} name Database with action
421533
function actionOn (name) {
  // Clear a possibly existing timeout
  clearTimeout(timeouts[name]);

  // Make sure user hasn't declined auto-close
  if(globalConfig.db.timeout < 0) return;

  // Set up auto-close
  timeouts[name] = setTimeout(function () {
    closeDatabase(name);
  }, globalConfig.db.timeout);
}
203200
public void active(String name) {
        SmartForest<NewWord> branch = sf.getBranch(name);
        if (branch != null && branch.getParam() != null) {
            branch.getParam().setActive(true);
        }
    }
227430
function (onDone) {

		// refuse any write or log creation
		l_logLock = true;

		//console.log(l_name + '::disposeAllLogs::waitClosing...');
		console.log(l_name + '::disposeAllLogs::closing ' + Object.keys(l_logs).length + ' log files...');

		l_onAllClosed = onDone;

		if (l_checkDoneBusy === false) {
			l_checkDoneBusy = true;
			l_checkLogClose();
		}
	}
214015
function destroyUser(name, pass, cb) {
  loginUser(name, pass, function(err, user) {
    if(err) return cb(err)
    nano().use(user_dbname).destroy(user._id, user._rev, function(err, doc) {
      if(err) return cb(err)
      user._id = doc.id
      user._rev = doc.rev
      destroyDatabase(name, function(err) {
        if(err) return cb(err)
        cb(null, user)
      })
    })
  })
  // var db = nano().use(user_dbname)
  // db.head(user_namespace+':'+name, function(err, b, h) {
    // if(err) return cb(err)
    // db.destroy(user_namespace+':'+name, JSON.parse(h.etag), function(err, doc) {
      // if(err) return cb(err)
      // destroyDatabase(name, function(err) {
        // if(err) return cb(err)
        // cb(null, doc)
      // })
    // })
  // })
}
720090
public void unbind(String name) throws ObjectNameNotFoundException
    {
        /**
         * Is DB open? ODMG 3.0 says it has to be to call unbind.
         */
        if (!this.isOpen())
        {
            throw new DatabaseClosedException("Database is not open. Must have an open DB to call unbind");
        }
        TransactionImpl tx = getTransaction();
        if (tx == null || !tx.isOpen())
        {
            throw new TransactionNotInProgressException("Tx is not open. Must have an open TX to call lookup.");
        }

        tx.getNamedRootsMap().unbind(name);
    }
822989
function debug(name) {
  function disabled(){}
  disabled.enabled = false;

  var match = skips.some(function(re){
    return re.test(name);
  });

  if (match) return disabled;

  match = names.some(function(re){
    return re.test(name);
  });

  if (!match) return disabled;

  function logger(msg) {
    msg = (msg instanceof Error) ? (msg.stack || msg.message) : msg;
    Function.prototype.apply.call(logger.log, this, arguments);
  }

  logger.log = exports.log;
  logger.enabled = true;

  return logger;
}
229427
function(name) {
    var handler = function(e) {
      //XXX add id to element
      _declaireLog.push(e);
    };
    var html = document.getElementsByTagName('html')[0];
    html.addEventListener(name, handler);
    return handler;
  }
676602
function(collectionName) {
    var updates = {
      query: {
        event_collection: collectionName
      }
    };
    ExplorerActions.update(this.state.activeExplorer.id, updates);
    this.refs['event-browser'].refs.modal.close();
  }
664675
def _perform_database_action(action, *args):
    
    session = _get_session()
    getattr(session, action)(*args)
    session.commit()
1012704
function( name, callback, context ) {
                var me = this;
    
                if ( !callback ) {
                    return me;
                }
    
                eachEvent( name, callback, function( name, callback ) {
                    var once = function() {
                            me.off( name, once );
                            return callback.apply( context || me, arguments );
                        };
    
                    once._cb = callback;
                    me.on( name, once, context );
                });
    
                return me;
            }
1214998
public function registerEvent(string $name, ?string $table = null, \Closure $action): void
    {
        $this->connection->getEventHandler()->registerEvent($name, $table, $action);
    }
1122229
def _doAction(self, action):
		""""""

		if self._db == '':
			raise FMError, 'No database was selected'

		result = ''

		try:
			request = [
				uu({'-db': self._db })
			]

			if self._layout != '':
				request.append(uu({'-lay': self._layout }))

			if action == '-find' and self._lop != 'and':
				request.append(uu({'-lop': self._lop }))

			if action in ['-find', '-findall']:

				if self._skipRecords != 0:
					request.append(uu({ '-skip': self._skipRecords }))

				if self._maxRecords != 0:
					request.append(uu({ '-max': self._maxRecords }))

				for i in range(0, len(self._sortParams)):
					sort = self._sortParams[i]
					request.append(uu({ '-sortfield.'+str(i+1): sort[0] }))

					if sort[1] != '':
						request.append(uu({ '-sortorder.'+str(i+1): sort[1] }))

			for dbParam in self._dbParams:

				if dbParam[0] == 'RECORDID':
					request.append(uu({ '-recid': dbParam[1] }))

				elif dbParam[0] == 'MODID':
					request.append(uu({ '-modid': dbParam[1] }))

				elif hasattr(dbParam[1], 'strftime'):
					d = dbParam[1]
					if (not hasattr(d, 'second')):
						request.append(uu({ dbParam[0]: d.strftime('%m-%d-%Y') }))
					else:
						request.append(uu({ dbParam[0]: d.strftime('%m-%d-%Y %H:%M:%S') }))
					del(d)
				else:
					request.append(uu({ dbParam[0]: dbParam[1] }))
			request.append(action)

			if self._extra_script:
				request += self._extra_script
				self._extra_script = None

			result = self._doRequest(request)

			try:
				result = FMResultset.FMResultset(result)
			except FMFieldError, value:
				realfields = FMServer(self._buildUrl(), self._db, self._layout).doView()

				l = []
				for k, v in self._dbParams:
					if k[-3:] != '.op' and k[0] != '-':
						l.append(("'%s'" % k.replace('::','.')).encode('utf-8'))
				raise FMError, "Field(s) %s not found on layout '%s'" % (', '.join(l), self._layout)

			if action == '-view':
				result = result.fieldNames

		finally:
			self._dbParams = []
			self._sortParams = []
			self._skipRecords = 0
			self._maxRecords = 0
			self._lop = 'and'

		return result
282088
public function close($name = null)
    {
        if (null === $name) {
            $name = $this->current ?: 'default';
        }

        if (isset($this->connections[$name])) {
            unset($this->connections[$name]);
        }
    }
834801
public function logSuccessfulMigration($name)
    {
        $this->db->insert($this->table, [
            'MIGRATION' => "'".$this->db->forSql($name)."'",
        ]);
    }
986328
function(obj, action, name, rest) {
    if (!name) return true;

    // Handle event maps.
    if (typeof name === 'object') {
      for (var key in name) {
        obj[action].apply(obj, [key, name[key]].concat(rest));
      }
      return false;
    }

    // Handle space separated event names.
    if (eventSplitter.test(name)) {
      var names = name.split(eventSplitter);
      for (var i = 0, l = names.length; i < l; i++) {
        obj[action].apply(obj, [names[i]].concat(rest));
      }
      return false;
    }

    return true;
  }
551561
function logTabularData( data ) {
      if( win.console.table ) {
         win.console.table( data );
      }
      else {
         consoleLog( JSON.stringify( data, null, 2 ) );
      }
   }
636683
function(name, action, context) {
        if (!name || !action) {
            return;
        }
        var self = this;
        function wrapper() {
            self.off(name, wrapper);
            action.apply(this, arguments);
        }
        return this.on(name, wrapper, context);
    }