ANNOUNCE: xsdb -- the eXtremely Simple Database goes alpha

Aaron Watters aaron at reportlab.com
Mon Jan 5 13:26:20 EST 2004


lipp at epost.de (Wolfgang Lipp) wrote in message news:<c0f3952d.0312290737.685678d6 at posting.google.com>...
> hi,
> 
> ....when i create 
> a database, populate it, commit, and then re-open it, i get a nasty
> xsdb.xsdbExceptions.RollBackError....

Thank you very much for finding this problem!

Double apologies: Sorry that I made this bug and sorry that I didn't
respond to your message earlier.  I decided take a different approach
than the one you suggested that fixes the problem systematically (and
required a lot of changes and testing).  

Basically I hadn't considered
the possibility that a program might open two direct connections 
to a database within the same minute (because my machine is so slow :( ).
If you do make very fast connections I added the ability to clear out
all the timestamp information using a special keyword argument to the
connection initializer.  Here is the test case (fastconnect.py):

===
"test connecting and then reconnecting to a database quickly"

def test(filename="data/fastconnect.dat"):
    import time
    now = time.time()
    from xsdb.KISSBaseHierarchy import xsdb
    print "testing fast reconnection"
    connection = xsdb(filename, startup=1)
    t = connection.transaction()
    t.add("object1", "this is the object")
    t.commit()
    t = connection.transaction()
    t.add("object2", "this is the other object")
    t.commit()
    connection = None
    # must clear the connection for fast reconnect!
    connection = xsdb(filename, startup=0, clear=1)
    print "fast reconnect completed in ", time.time()-now

if __name__=="__main__":
    test()
===

If you omit the "clear=1" above you get the exception you reported.

I just uploaded a new file release which includes this and a number
of other bugfixes, enhancements, doc changes, etcetera.  Get it at:

http://xsdb.sourceforge.net

  -- Aaron Watters

===
You can't talk to a man
When he don't wanna understand  -- Carole King



More information about the Python-list mailing list