/ Published in: Python

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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()
Comments
