[Zope] get_transaction().commit() does not commit : OOBTree

Harm_Kirchhoff at mail.digital.co.jp Harm_Kirchhoff at mail.digital.co.jp
Fri Nov 14 05:57:55 EST 2003


 I guess it is another newbie question, but I can not save data to the DB:

I open the DB like this:

        self.st = FileStorage.FileStorage(self.mountedDB)
        self.db = DB(self.st)
        self.connection = self.db.open()
        self.dbroot = self.connection.root()
        self.dbroot = OOBTree()
        return (True,'db mounted:'+ self.mountedDB)

 Next I make a number of changes to self.dbroot:

        self.dbroot[CstNo] [FY] ['1'] ['E']        = {} 
        self.dbroot[CstNo] [FY] ['1'] ['S']        = {}
        self.dbroot[CstNo] [FY] ['1'] ['accno']    = {}
        self.dbroot[CstNo] [FY] ['1'] ['acba' ]    = {}

        self._p_changed = 1
        get_transaction().commit()

And then I close:

        get_transaction().commit()     # commit any changes that may be 
pending.
        self.connection.close()
        self.db.close()
        self.st.close()

When I open again and try verify whether the keys exist, using 
self.dbroot.has_key(CstNo)   # for example
they do not exist.
Looking at the DB with a text editor to see what is in there, reveals that 
there is nothing.
The entire program runs through without any error.
HOWEVER, if I mark out the line:
        # self.dbroot = OOBTree()
It all works according to plan !!!

Does anybody have an idea what is wrong with my usage of the OOBTree  ???





More information about the Zope mailing list