Dolda2000 GitWeb
/
didex.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added an explicit index type for object IDs.
[didex.git]
/
didex
/
db.py
diff --git
a/didex/db.py
b/didex/db.py
index
316fa02
..
33eb0d8
100644
(file)
--- a/
didex/db.py
+++ b/
didex/db.py
@@
-2,6
+2,8
@@
import time, threading, struct
from . import lib
from bsddb3 import db as bd
from . import lib
from bsddb3 import db as bd
+__all__ = ["environment", "database"]
+
deadlock = bd.DBLockDeadlockError
class environment(lib.closable):
deadlock = bd.DBLockDeadlockError
class environment(lib.closable):
@@
-92,6
+94,15
@@
class txn(object):
def postcommit(self, fun):
self.pcommit.add(fun)
def postcommit(self, fun):
self.pcommit.add(fun)
+def dloopfun(fun):
+ def wrapper(self, *args, **kwargs):
+ while True:
+ try:
+ return fun(self, *args, **kwargs)
+ except deadlock:
+ continue
+ return wrapper
+
def txnfun(envfun):
def fxf(fun):
def wrapper(self, *args, tx=None, **kwargs):
def txnfun(envfun):
def fxf(fun):
def wrapper(self, *args, tx=None, **kwargs):