2#include <boost/array.hpp>
14 _db_file(dir,
flags &
database::read_write, shared_file_size, allow_dirty, db_map_mode),
27#ifdef CHAINBASE_CHECK_LOCKING
28 _enable_require_locking = enable_require_locking;
32#ifdef CHAINBASE_CHECK_LOCKING
33 void database::require_lock_fail(
const char* method,
const char* lock_type,
const char* tname )
const
35 std::string err_msg =
"database::" + std::string( method ) +
" require_" + std::string( lock_type ) +
"_lock() failed on type " + std::string( tname );
36 std::cerr << err_msg << std::endl;
37 BOOST_THROW_EXCEPTION( std::runtime_error( err_msg ) );
43 for(
auto& item : _index_list )
51 for(
auto& item : _index_list )
59 for(
auto& item : _index_list )
67 for(
auto& item : _index_list )
76 vector< std::unique_ptr<abstract_session> > _sub_sessions;
77 _sub_sessions.reserve( _index_list.size() );
78 for(
auto& item : _index_list ) {
79 _sub_sessions.push_back( item->start_undo_session( enabled ) );
81 return session( std::move( _sub_sessions ) );
database(const bfs::path &dir, open_flags write=read_only, uint64_t shared_file_size=0, bool allow_dirty=false, pinnable_mapped_file::map_mode=pinnable_mapped_file::map_mode::mapped)
session start_undo_session(bool enabled)
void commit(int64_t revision)
void set_require_locking(bool enable_require_locking)
CK_SESSION_HANDLE session
unsigned __int64 uint64_t