Return to Snippet

Revision: 50304
at August 18, 2011 02:50 by eristoddle


Initial Code
from ZODB import DB
from ZODB.FileStorage import FileStorage
from BTrees.OOBTree import OOBTree
import transaction

class erpJobStore():

	def __init__(self, datapath):
		self.storage = FileStorage(datapath + "jobstore.fs")
		self.db = DB(self.storage)
		self.connection = self.db.open()
		self.dbroot = self.connection.root()

	def __del__(self):
		self.closeConnection()

	def doCommit(self):
		self._p_changed = 1
		transaction.commit()

	def closeConnection(self):
		transaction.abort()
		self.db.close()
		self.connection.close()

Initial URL

                                

Initial Description

                                

Initial Title
ZODB Class Template

Initial Tags

                                

Initial Language
Python