[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] PyQt and database locking problems
From:       Hans-Peter Jansen <hpj () urpla ! net>
Date:       2006-12-19 19:28:55
Message-ID: 200612192028.56290.hpj () urpla ! net
[Download RAW message or body]

Am Dienstag, 19. Dezember 2006 18:02 schrieb joanne matthews (RRes-Roth):
> I am getting database locking problems with pyqt and sqlite when I
> execute a QSqlQuery.
> I don't have the same error if I use another database with less records
> in the table.
> Also, If I scroll to the bottom of the qTableView then execute the
> query, I don't get
> A database locked message. This problem has been driving me insane now
> for quite sometime
> As I have now run out of ideas to try.  If the problem was due to there
> being an active query
> On the database then why does it work if I just scroll down to the
> bottom of the table?
> I have attached some source code which demonstates the
> Problem and a database. Clicking on remove should just remove the
> selected row from the table.
>
> I have tried model.clear(), qsqlquery.clear(), transaction() and
> commit().
> I've also increased the sqlite timeout.
>
> If anyone can advise me or tell me why I'm getting the problem I'd be
> Really greatful.

Well, from your description you're most probably bitten due to Qt delaying 
the table fetch until the records are needed (displayed).

You should consider using another db connection..

Pete

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic