On Thu, May 06, 2010 at 12:18:14AM -0700, Paul Rigor (gmail) wrote:
> There's also a weird bug when you attempt to "commit" a transaction.
> Through the python wrapper, an error is thrown even though the commit
> call is appropriately placed. Your python code may fail, but double
> check your sqlite3 because the data is *most likely* safely committed.
>
> Not sure if this is related though =P
Hey Paul,
I haven't seen this myself -- would you be able to give me a fairly
small bit of code that demonstrates the problem?
thanks!
--titus
> On Wed, May 5, 2010 at 11:51 PM, Kenny Daily <
kmd...@gmail.com> wrote:
> > I had a similar problem too. I was using the cursor obtained from:
> >
> > cursor = myannotdb.sliceDB.cursor
> >
> > I would not see insert statements that I executed using this cursor. I
> > fixed (with other issues coming from doing this) by calling:
> >
> > cursor.execute("BEGIN TRANSACTION")
> >
> > before each sql insert call. But, if the script running this fails, it
> > leave the database in a locked state.
> >
> > Kenny
> >
> > On May 3, 11:51?pm, jbiesinger <
jake.biesin...@gmail.com> wrote:
> >> I think it would be wise to update the tutorial site with a commit
> >> statement...
> >>
> >> On May 3, 11:41?pm, jbiesinger <
jake.biesin...@gmail.com> wrote:
> >>
> >>
> >>
> >>
> >>
> >> > Partially resolved...
> >>
> >> > liteserver._connection.commit() did it, though I doubt that's the
> >> > proper way to do it. ?The code I'm testing creates and populates two
> >> > sqlite tables. ?If this is a bug, it might be helpful to note that the
> >> > first table (which was created and populated first) was flushed to
> >> > disk without the commit statement, meaning that only the last table
> >> > was being lost. ?Perhaps the "create table" statement has an implicit
> >> > commit?
> >>
> >> > Now, I'm running into the unicode issue you posted about. ?I'll try
> >> > out your patch to see if it resolves it.
> >>
> >> > On May 3, 5:47?pm, "C. Titus Brown" <
c...@msu.edu> wrote:
> >>
> >> > > Try liteserver.commit() before the close() (well, you'll need to get a db handle somehow - liteserver may not be it. ?More when I get to my laptop.)
> >> > > > Hi! ?I'm just trying out the tutorial on using sqlite as a backend as
> >> > > > seen in
> >> > > >
http://biodb.bioinformatics.ucla.edu/pygr_docs/0.8.1/html/tutorials/d...
> >> > > > It seems that the sqlite rows aren't being saved properly. ?I'm
> >> > > > running python2.6 on Ubuntu 10.04, pygr version 0.8.1.
> >>
> >> > > > # Set up the DB, add a few rows
> >> > > > from pygr import sqlgraph
> >> > > > liteserver = sqlgraph.SQLiteServerInfo('/home/wbiesing/test/
> >> > > > slicedb.sqlite')
> >> > > > txInfo = sqlgraph.SQLTable('annotations', serverInfo=liteserver,
> >> > > > ? ? ? ? ? ?writeable=True,
> >> > > > ? ? ? ? ? ?createTable='CREATE TABLE annotations (k INTEGER PRIMARY
> >> > > > KEY, seq_id TEXT, start INT, stop INT, orientation INT);')
> >> > > > txInfo.new(k=0,seq_id='chr1',start=0,stop=50,orientation=1)
> >> > > > txInfo.new(k=1,seq_id='chrX',start=20,stop=250,orientation=-1)
> >> > > > liteserver.close()
> >>
> >> > > > # there are no rows in the db.
> >> > > > sqlite3 /home/wbiesing/test/slicedb.sqlite
> >> > > > SQLite version 3.6.22
> >> > > > Enter ".help" for instructions
> >> > > > Enter SQL statements terminated with a ";"
> >> > > > sqlite> .tables
> >> > > > annotations
> >> > > > sqlite> .schema
> >> > > > CREATE TABLE annotations (k INTEGER PRIMARY KEY, seq_id TEXT, start
> >> > > > INT, stop INT, orientation INT);
> >> > > > sqlite> select * from annotations;
> >> > > > sqlite>
> >>
> >> > > > I can add rows and wrap them in an annotation database, but as soon as
> >> > > > I leave the python session, the data is lost. ?It's not just being