From 3d344e8b07c84320422f7ce88e3f470c4d53138d Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Fri, 27 Jan 2006 07:06:15 +0000 Subject: [PATCH] Add wrapper for DBEnv.set_tx_timeout method to allow time based DB_RECOVER (test cases and dbobj wrapping) --- Lib/bsddb/dbobj.py | 2 ++ Lib/bsddb/test/test_basics.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/Lib/bsddb/dbobj.py b/Lib/bsddb/dbobj.py index 667ec314d3..5bcf84bbb9 100644 --- a/Lib/bsddb/dbobj.py +++ b/Lib/bsddb/dbobj.py @@ -77,6 +77,8 @@ class DBEnv: return apply(self._cobj.txn_stat, args, kwargs) def set_tx_max(self, *args, **kwargs): return apply(self._cobj.set_tx_max, args, kwargs) + def set_tx_timestamp(self, *args, **kwargs): + return apply(self._cobj.set_tx_timestamp, args, kwargs) def lock_detect(self, *args, **kwargs): return apply(self._cobj.lock_detect, args, kwargs) def lock_get(self, *args, **kwargs): diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 844d6b79e6..24c4038870 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -11,6 +11,7 @@ import string import tempfile from pprint import pprint import unittest +import time try: # For Pythons w/distutils pybsddb @@ -64,6 +65,8 @@ class BasicTestCase(unittest.TestCase): try: self.env = db.DBEnv() self.env.set_lg_max(1024*1024) + self.env.set_tx_max(30) + self.env.set_tx_timestamp(int(time.time())) self.env.set_flags(self.envsetflags, 1) self.env.open(homeDir, self.envflags | db.DB_CREATE) tempfile.tempdir = homeDir -- 2.40.0