[BioPython] BioSQL without commit

Brad Chapman chapmanb at uga.edu
Thu Jul 10 13:45:44 EDT 2003


Hello;

> I write a program to load genbank files into the
> biodatabase following instructions in the tutorial
> given by Brad. When the program is running, everything
> is right and Records are all deposited in the
> biodatabases. However, When the program exits, there
> is no record physically residing in the biodatabase. 
> 
> SQL without commit may be the cause. 
> 
> Anyone give a clue?

Right now you need to commit the changes and close the database
after doing a load. This is not covered in the documentation
because, uh, I forgot it. Thanks for pointing out my oversight.
It is also an ugly way to do things so I should clean it up when 
I update BioSQL (hopefully soon, still way behind over here) in
addition to documenting it. Any ideas about how to make it cleaner are
gratefully accepted. Right now the thing to do after the load is:

server.adaptor.conn.commit()
server.adaptor.conn.close()

and this should get everything committed. Probably the right thing
to do is to have a database function so that you can do:

db.load(iterator)
db.commit_and_close()

or something of that sort.

Thanks for the question. Hope this helps!
Brad


More information about the BioPython mailing list