[Qt-interest] QSQLITE and Network Shares

Jason H scorp1us at yahoo.com
Thu Nov 12 05:09:08 CET 2009


I've seen this problem in Windows. 

It is not Qt's fault. If anything it is SQLite's. I've seen it on local files when you have too many connections open, or opened too many in too short of a time period. I just ended up spinning on the error until it goes away. Fortunately for me, it was not anything that was mission critical, just a helper app.

I'd see about moving to PostgreSQL, or developing a driver for one of the network wrappers (http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork) which should get you around the problem you're having. 

It would be cool is Qt formally supported one of the networked SQLite wrappers....






________________________________
From: Israel Brewster <israel at frontierflying.com>
To: Sylvain Pointeau <sylvain.pointeau at gmail.com>
Cc: "Qt Interest (qt-interest at trolltech.com)" <qt-interest at trolltech.com>
Sent: Wed, November 11, 2009 1:50:18 PM
Subject: Re: [Qt-interest] QSQLITE and Network Shares


On Nov 11, 2009, at 8:42 AM, Sylvain Pointeau wrote:

SQLite needs to put a lock on the file, but the network drives have all a issue with that.
>it is explained on the sqlite website.

Thanks for the response. However, the problem can not be an inherent SQLite problem because, as I explained in my original message, the sqlite command-line utility works fine this way, even on the same file created by Qt. Actually, on the SQLite website it is explained that it SHOULD work just fine for low volume usage (which this obviously is) -that's why I am trying it. They do point out some caveats with windows or NFS shares, where it SOMETIMES (not always) doesn't work, but I am not using either. To quote (from http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork ):

Using SQLite on a Network
SQLite database files may be shared accross a network using a network filesystem.

They go on to say it won't be particularly efficient (which I don't care about, at least at the moment), and that it may have problems with certain file systems (specified elsewhere as NFS and FAT, neither of which I am using), but the point is it should work. And does, at least from the command line. It is just Qt that has problems with this, at least on my system. So the question really is, is this an inherent problem with Qt, or just a problem with my build? Thanks for any help!


>
>I fear that there is no solution to your problem...
>
>
>Cheers,
>Sylvain
>
>
>On Wed, Nov 11, 2009 at 6:25 PM, Israel Brewster <israel at frontierflying.com> wrote:
>
>If it helps, I am attaching a simple unit test case that illustrates the problem, at least on my system. If this doesn't occur for other people, I would be interested in knowing that too. The test asks you to select a location for a database, and then creates it and attempts a simple CREATE TABLE and SELECT. On my machine, if I select a local directory, it works. If I select a mounted network share, it fails. As stated, I am running Mac OS X 10.5.8 with Qt 4.5.2. The share is an AFP share (I also tried with a SMB share, same result). Thanks for any help that can be provided!
>>
>>
>>
>>
>>On Nov 10, 2009, at 2:36 PM, Israel Brewster wrote:
>>
>>Running Mac OS X 10.5, Qt 4.5.2. I am having a problem using QSqlDatabase with the SQLITE driver if the database file is located on a network share. The database opens fine, being created if it doesn't exist (QSqlDatabase::open returns true), but as soon as I try to do anything with the database (such as select) I get an error saying "database is locked Unable to execute statement" - this happens even if the database file didn't exist prior to the call to open, which takes place immediately before the attempted SQL execution. If I use the command line version of SQLite on the same file, it works fine. Also, the same file, if moved to a local directory, works - the problem only occurs when the database is on a network share.. What can I do to fix this issue? Thanks.
>>>
>>>
>>>-----------------------------------------------
>>>Israel Brewster
>>>Computer Support Technician II
>>>Frontier Flying Service Inc.
>>>5245 Airport Industrial Rd
>>>Fairbanks, AK 99709
>>>(907) 450-7250 x293
>>>-----------------------------------------------
>>>
>>><Israel Brewster.vcf>
>>> 
>>>_______________________________________________
>>>Qt-interest mailing list
>>>Qt-interest at trolltech.com
>>>http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>>
>>
>>-----------------------------------------------
>>Israel Brewster
>>Computer Support Technician II
>>Frontier Flying Service Inc.
>>5245 Airport Industrial Rd
>>Fairbanks, AK 99709
>>(907) 450-7250 x293
>>-----------------------------------------------
>>
>>
>>
>>
>>
>>
>> 
>>
>>_______________________________________________
>>Qt-interest mailing list
>>Qt-interest at trolltech.com
>>http://lists.trolltech.com/mailman/listinfo/qt-interest
>>
>>
>

-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091111/f3324735/attachment.html 


More information about the Qt-interest-old mailing list