Re: [sqlite] Database gets locked for other processes
I know well the qt sqlite to say, maybe you aren't destroing the QSqlQuery class or simple call finish function, and the statement is openned helding the lock! Enviado via iPhone > Em 29/10/2013, às 10:51, Stephan Bealescreveu: > >> On Tue, Oct 29, 2013 at 1:52 PM, Martin wrote: >> >> The program is running on Windows7. >> ... > > The program runs parallel on multiple machines all sharing the same >> SQLite-Database-file. > > > Connecting multiple clients over a network share is a sure-fire way to > corrupt your database. See the bottom half of this page: > > http://www.sqlite.org/whentouse.html > > as well as any number of threads in this mailing list archives regarding > this topic. > > -- > - stephan beal > http://wanderinghorse.net/home/stephan/ > http://gplus.to/sgbeal > "Since tyranny's the only guaranteed byproduct of those who insist on a > perfect world, freedom will have to do." -- Bigby Wolf > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Database gets locked for other processes
"Martin Kropfinger" Am Tue, 29 Oct 2013 12:00:02 -0400 schrieb sqlite-users-requ...@sqlite.org: Date: Tue, 29 Oct 2013 14:51:08 +0100 From: Stephan Beal <sgb...@googlemail.com> To: General Discussion of SQLite Database <sqlite-users@sqlite.org> Subject: Re: [sqlite] Database gets locked for other processes Message-ID: <cakd4naigijjvwbks7z2-s_v3j+ingts5ugrnft3krjjytex...@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 On Tue, Oct 29, 2013 at 1:52 PM, Martin <free...@rakor-net.de> wrote: > The program is running on Windows7. > ... The program runs parallel on multiple machines all sharing the same > SQLite-Database-file. Connecting multiple clients over a network share is a sure-fire way to corrupt your database. See the bottom half of this page: http://www.sqlite.org/whentouse.html as well as any number of threads in this mailing list archives regarding this topic. I can understand this. But I need to have the database unconnected to a special sever. In fact it has the same issues if I run more than one program on the same machine tying to access the same lokal databasefile. First of all, everything that every one has said here damaging the DB, is correct. so, if you want to continue, read on... I have a system of 10 people that use a program manager tool that uses SQLite3 as the main DB using a server shared db. I have been able to use it by putting a block outside of SQLite when someone is writing to the DB. What I do is that I have a place in the same server, or even same spot where the DB lives, that a file will be created before someone is going to write to the DB. This file will tell the tool that someone is writing to the DB and no one else will be allow to write. They can read, but not write. When the tool is going to write to the DB, it checks to see if that file is there. If it is, it waits for a few seconds and it checks again until that file is deleted. However, this causes the users, sometimes, to complain of slow response. I tell them what is going on, but they still harrass me. Anyway, again, doing this could damaged your DB, but if you really need this to work, there are ways of working around it. By the way, before figuring this out, I damaged my DB a few times, so you better make sure you have a good backup system. Ihth. josé ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Database gets locked for other processes
Am Tue, 29 Oct 2013 12:00:02 -0400 schrieb sqlite-users-requ...@sqlite.org: > Date: Tue, 29 Oct 2013 14:51:08 +0100 > From: Stephan Beal <sgb...@googlemail.com> > To: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Subject: Re: [sqlite] Database gets locked for other processes > Message-ID: > <cakd4naigijjvwbks7z2-s_v3j+ingts5ugrnft3krjjytex...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > On Tue, Oct 29, 2013 at 1:52 PM, Martin <free...@rakor-net.de> wrote: > > > The program is running on Windows7. > > ... > > The program runs parallel on multiple machines all sharing the same > > SQLite-Database-file. > > > Connecting multiple clients over a network share is a sure-fire way to > corrupt your database. See the bottom half of this page: > > http://www.sqlite.org/whentouse.html > > as well as any number of threads in this mailing list archives > regarding this topic. > I can understand this. But I need to have the database unconnected to a special sever. In fact it has the same issues if I run more than one program on the same machine tying to access the same lokal databasefile. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Database gets locked for other processes
On Tue, Oct 29, 2013 at 1:52 PM, Martinwrote: > The program is running on Windows7. > ... The program runs parallel on multiple machines all sharing the same > SQLite-Database-file. Connecting multiple clients over a network share is a sure-fire way to corrupt your database. See the bottom half of this page: http://www.sqlite.org/whentouse.html as well as any number of threads in this mailing list archives regarding this topic. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Database gets locked for other processes
Sounds like something changed in Qt 5.1.1 so that it is holding open a read transaction. The first process acquires the read transaction, which permits other processes to read but prevents anybody else from writing. I have no idea why Qt would do this, though. You can change to WAL mode, which will allow other processes to write while the original process holds the read transaction open. But with the read transaction active, you'll never be able to checkpoint and so the WAL file will grow without bound. Things will appear to work at first, but you will eventual run into performance problems with a huge WAL file. I think your goal should be to figure out why Qt 5.1.1 is holding open the read transaction. On Tue, Oct 29, 2013 at 8:52 AM, Martinwrote: > Hi there! > > I have a program written in Qt and using the SQLite-drivers shipped with > Qt. > AFAIK those are the original SQLite-drivers. The program is running on > Windows7. > > Originally the program was written using Qt4.8 (which came with SQLite > 3.7.14.1). The program runs parallel on multiple machines all sharing the > same > SQLite-Database-file. The programs have 99% reading access (SELECT). Some > times > there will be some data written/changed. All clients may change the data. > Until now this worked without issues. > > Now I am porting the program from Qt 4.8 to Qt 5.1.1 (shipping SQLite > 3.7.17) > and am running in trouble with parallel access to the database-file. The > first > program accessing the database can work normally with the database. But all > programs starting > later can only access the database for reading. If one of them wants to > write > data in the database I get a "database-locked-error". > > Can you tell me if I am doing something wrong, or if there is a good > reason for > this habbit? > > All the programs connect to database at startup and close the > databaseconnection > on program close. > > Thanks for your help > > Martin > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Database gets locked for other processes
Hi there! I have a program written in Qt and using the SQLite-drivers shipped with Qt. AFAIK those are the original SQLite-drivers. The program is running on Windows7. Originally the program was written using Qt4.8 (which came with SQLite 3.7.14.1). The program runs parallel on multiple machines all sharing the same SQLite-Database-file. The programs have 99% reading access (SELECT). Some times there will be some data written/changed. All clients may change the data. Until now this worked without issues. Now I am porting the program from Qt 4.8 to Qt 5.1.1 (shipping SQLite 3.7.17) and am running in trouble with parallel access to the database-file. The first program accessing the database can work normally with the database. But all programs starting later can only access the database for reading. If one of them wants to write data in the database I get a "database-locked-error". Can you tell me if I am doing something wrong, or if there is a good reason for this habbit? All the programs connect to database at startup and close the databaseconnection on program close. Thanks for your help Martin ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users