diff options
author | Mathias Stearn <mathias@10gen.com> | 2014-04-28 20:55:18 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2014-04-29 09:14:59 -0400 |
commit | de5ea8fd8682d086de86636d9fff80720939790e (patch) | |
tree | bc1ad8171f539a97333df978fbae16aa53a490f9 /src/mongo/dbtests/pdfiletests.cpp | |
parent | a16b3afd4f6760a8818da0888ebd330e92d381a2 (diff) | |
download | mongo-de5ea8fd8682d086de86636d9fff80720939790e.tar.gz |
SERVER-13643 Move Txn pluming above Database and Collection
Diffstat (limited to 'src/mongo/dbtests/pdfiletests.cpp')
-rw-r--r-- | src/mongo/dbtests/pdfiletests.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/dbtests/pdfiletests.cpp b/src/mongo/dbtests/pdfiletests.cpp index d4a00be89f7..a3bc2ad237f 100644 --- a/src/mongo/dbtests/pdfiletests.cpp +++ b/src/mongo/dbtests/pdfiletests.cpp @@ -39,6 +39,7 @@ #include "mongo/db/storage/data_file.h" #include "mongo/db/storage/extent.h" #include "mongo/db/storage/extent_manager.h" +#include "mongo/db/storage/mmap_v1/dur_transaction.h" #include "mongo/dbtests/dbtests.h" namespace PdfileTests { @@ -51,7 +52,7 @@ namespace PdfileTests { virtual ~Base() { if ( !collection() ) return; - _context.db()->dropCollection( ns() ); + _context.db()->dropCollection( &_txn, ns() ); } protected: const char *ns() { @@ -63,6 +64,7 @@ namespace PdfileTests { Lock::GlobalWrite lk_; Client::Context _context; + DurTransaction _txn; }; class InsertNoId : public Base { @@ -70,15 +72,15 @@ namespace PdfileTests { void run() { BSONObj x = BSON( "x" << 1 ); ASSERT( x["_id"].type() == 0 ); - Collection* collection = _context.db()->getOrCreateCollection( ns() ); - StatusWith<DiskLoc> dl = collection->insertDocument( x, true ); + Collection* collection = _context.db()->getOrCreateCollection( &_txn, ns() ); + StatusWith<DiskLoc> dl = collection->insertDocument( &_txn, x, true ); ASSERT( !dl.isOK() ); StatusWith<BSONObj> fixed = fixDocumentForInsert( x ); ASSERT( fixed.isOK() ); x = fixed.getValue(); ASSERT( x["_id"].type() == jstOID ); - dl = collection->insertDocument( x, true ); + dl = collection->insertDocument( &_txn, x, true ); ASSERT( dl.isOK() ); } }; |