[Zope] get_transaction().commit() seems not to work ?

Harm_Kirchhoff at mail.digital.co.jp Harm_Kirchhoff at mail.digital.co.jp
Wed Dec 10 00:08:16 EST 2003


 I seem not to be able to save my data to ZODB, I wonder what I do wrong 
here:

At the python shell:
>>> test()
Here it is:
['testme']
{'testme': {'i love tests': [1, 2, 3]}}
... and now its empty ! Magic ???
{}
>>> 

where test() is defined as:

def test():
 
    storage     = FileStorage.FileStorage('C:\Documents and 
Settings\Kirchhoff\My Documents\SALES\DataBase\SalesDB.fs')
    db          = DB(storage)
    connection  = db.open()
    dbroot      = connection.root()

    DB.dbroot = { 'testme' : {'i love tests' : [1,2,3]}}
    get_transaction().commit()
    print 'Here it is:'
    print DB.dbroot.keys()
    pprint.pprint(DB.dbroot) 
 
    connection.close()
    db.close()
    storage.close()

    storage     = FileStorage.FileStorage('C:\Documents and 
Settings\Kirchhoff\My Documents\SALES\DataBase\SalesDB.fs')
    db          = DB(storage)
    connection  = db.open()
    dbroot      = connection.root()
    print '... and now its empty ! Magic ???'
    pprint.pprint(dbroot)
    connection.close()
    db.close()
    storage.close()
    return
 



More information about the Zope mailing list