transaction; set db.DB_TXN_NOSYNC flag on an environment;
Remove lock limits; set db.DB_LOG_AUTOREMOVE flag; add checkpoints on: open, batch transaction start and end; close. * src/GrampsDb/_GrampsDbBase.py (change_database, no_database): close existing db before changing to the new one. svn: r5768
This commit is contained in:
parent
e3395609b1
commit
c09e8ba99d
@ -1,7 +1,11 @@
|
|||||||
2006-01-16 Alex Roitman <shura@gramps-project.org>
|
2006-01-16 Alex Roitman <shura@gramps-project.org>
|
||||||
* src/ViewManager: Remov unused code.
|
* src/ViewManager: Remov unused code.
|
||||||
* src/GrampsDb/_GrampsBSDDB.py: Do small txn during batch
|
* src/GrampsDb/_GrampsBSDDB.py: Do small txn during batch
|
||||||
transaction; set db.DB_TXN_NOSYNC flag on an environment.
|
transaction; set db.DB_TXN_NOSYNC flag on an environment;
|
||||||
|
Remove lock limits; set db.DB_LOG_AUTOREMOVE flag; add checkpoints
|
||||||
|
on: open, batch transaction start and end; close.
|
||||||
|
* src/GrampsDb/_GrampsDbBase.py (change_database, no_database):
|
||||||
|
close existing db before changing to the new one.
|
||||||
|
|
||||||
2006-01-16 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
2006-01-16 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||||
* src/PedView.py: Edit on doublecklick; only right click gives
|
* src/PedView.py: Edit on doublecklick; only right click gives
|
||||||
|
@ -256,9 +256,8 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
|
|
||||||
self.env = db.DBEnv()
|
self.env = db.DBEnv()
|
||||||
self.env.set_cachesize(0,0x2000000) # 2MB
|
self.env.set_cachesize(0,0x2000000) # 2MB
|
||||||
self.env.set_lk_max_locks(10000) # 10K locks
|
self.env.set_flags(db.DB_TXN_NOSYNC,1) # async txn
|
||||||
self.env.set_lk_max_objects(10000) # 10K lock objects
|
self.env.set_flags(db.DB_LOG_AUTOREMOVE,1) # clean up unused logs
|
||||||
self.env.set_flags(db.DB_TXN_NOSYNC,1)
|
|
||||||
# The DB_PRIVATE flag must go if we ever move to multi-user setup
|
# The DB_PRIVATE flag must go if we ever move to multi-user setup
|
||||||
env_flags = db.DB_CREATE|db.DB_PRIVATE|\
|
env_flags = db.DB_CREATE|db.DB_PRIVATE|\
|
||||||
db.DB_INIT_MPOOL|db.DB_INIT_LOCK|\
|
db.DB_INIT_MPOOL|db.DB_INIT_LOCK|\
|
||||||
@ -269,6 +268,7 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
if not os.path.isdir(env_name):
|
if not os.path.isdir(env_name):
|
||||||
os.mkdir(env_name)
|
os.mkdir(env_name)
|
||||||
self.env.open(env_name,env_flags)
|
self.env.open(env_name,env_flags)
|
||||||
|
self.env.txn_checkpoint()
|
||||||
|
|
||||||
self.full_name = os.path.abspath(name)
|
self.full_name = os.path.abspath(name)
|
||||||
self.brief_name = os.path.basename(name)
|
self.brief_name = os.path.basename(name)
|
||||||
@ -783,6 +783,7 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
self.pid_trans.close()
|
self.pid_trans.close()
|
||||||
self.reference_map_primary_map.close()
|
self.reference_map_primary_map.close()
|
||||||
self.reference_map_referenced_map.close()
|
self.reference_map_referenced_map.close()
|
||||||
|
self.env.txn_checkpoint()
|
||||||
self.env.close()
|
self.env.close()
|
||||||
|
|
||||||
if not self.readonly:
|
if not self.readonly:
|
||||||
@ -1066,6 +1067,8 @@ class GrampsBSDDB(GrampsDbBase):
|
|||||||
|
|
||||||
# Commit BSD DB transaction -- DBTxn
|
# Commit BSD DB transaction -- DBTxn
|
||||||
self.txn.commit()
|
self.txn.commit()
|
||||||
|
if transaction.batch:
|
||||||
|
self.env.txn_checkpoint()
|
||||||
self.txn = None
|
self.txn = None
|
||||||
|
|
||||||
def undo(self):
|
def undo(self):
|
||||||
@ -1476,6 +1479,8 @@ class BdbTransaction(Transaction):
|
|||||||
Transaction.__init__(self,msg,db)
|
Transaction.__init__(self,msg,db)
|
||||||
self.reference_del = []
|
self.reference_del = []
|
||||||
self.reference_add = []
|
self.reference_add = []
|
||||||
|
if self.batch:
|
||||||
|
self.env.txn_checkpoint()
|
||||||
|
|
||||||
|
|
||||||
_attribute_conversion_9 = {
|
_attribute_conversion_9 = {
|
||||||
|
@ -1885,11 +1885,13 @@ class DbState(GrampsDBCallback):
|
|||||||
return self.active
|
return self.active
|
||||||
|
|
||||||
def change_database(self,db):
|
def change_database(self,db):
|
||||||
|
self.db.close()
|
||||||
self.db = db
|
self.db = db
|
||||||
self.open = True
|
self.open = True
|
||||||
self.emit('database-changed',(self.db,))
|
self.emit('database-changed',(self.db,))
|
||||||
|
|
||||||
def no_database(self):
|
def no_database(self):
|
||||||
|
self.db.close()
|
||||||
self.db = GrampsDbBase()
|
self.db = GrampsDbBase()
|
||||||
self.open = False
|
self.open = False
|
||||||
self.emit('no-database')
|
self.emit('no-database')
|
||||||
|
Loading…
Reference in New Issue
Block a user