Esempio n. 1
0
    void Client::Context::_finishInit() {
        _db = dbHolder().getOrCreate(_txn, _ns, _justCreated);
        invariant(_db);

        if( _doVersion ) checkNotStale();

        _client->_curOp->enter( this );
    }
Esempio n. 2
0
    void Client::Context::_finishInit() {
        _db = dbHolder().openDb(_txn, _ns, &_justCreated);
        invariant(_db);

        if( _doVersion ) checkNotStale();

        _client->_curOp->enter(_ns.c_str(), _db->getProfilingLevel());
    }
Esempio n. 3
0
    void Client::Context::_finishInit() {
        OperationContextImpl txn; // TODO get rid of this once reads require transactions
        _db = dbHolder().getOrCreate(&txn, _ns, _justCreated);
        invariant(_db);

        if( _doVersion ) checkNotStale();

        _client->_curOp->enter( this );
    }
Esempio n. 4
0
 // invoked from ReadContext
 Client::Context::Context(const string& ns, Database *db, bool doVersion) :
     _client( currentClient.get() ), 
     _justCreated(false),
     _doVersion( doVersion ),
     _ns( ns ), 
     _db(db)
 {
     verify(_db);
     if (_doVersion) checkNotStale();
     _client->_curOp->enter( this );
 }
Esempio n. 5
0
 void Client::Context::_finishInit() {
     dassert( Lock::isLocked() );
     int writeLocked = Lock::somethingWriteLocked();
     if ( writeLocked && FileAllocator::get()->hasFailed() ) {
         uassert(14031, "Can't take a write lock while out of disk space", false);
     }
     
     _db = dbHolderUnchecked().getOrCreate( _ns , _path , _justCreated );
     verify(_db);
     if( _doVersion ) checkNotStale();
     massert( 16107 , str::stream() << "Don't have a lock on: " << _ns , Lock::atLeastReadLocked( _ns ) );
     _client->_context = this;
     _client->_curOp->enter( this );
 }
Esempio n. 6
0
 // invoked from ReadContext
 Client::Context::Context(const string& path, const string& ns, Database *db) :
     _client( currentClient.get() ), 
     _oldContext( _client->_context ),
     _path( path ), 
     _justCreated(false),
     _doVersion( true ),
     _ns( ns ), 
     _db(db)
 {
     verify(_db);
     checkNotStale();
     _client->_context = this;
     _client->_curOp->enter( this );
 }