Hello ch,

I  ran  into  a  similar  problem when I was trying to use WAL mode. I
ended up just turning it off. It seemed that once there was contention
for  the  file  it never recovered. This was in windows. I didn't look
into  it  any  deeper  than this.  The same code works fine in journal
mode.  I  haven't  tried  it  again with the latest.    I think I last
tested this in 3.8.8.2.

There's  typically  not  much more than 2-3 connections contending for
file  access  in my program. Most of the time it's only one connection
at a time.

I  assumed  it  was something I was doing because I wasn't reading any
other reports of it. 

C


Monday, August 10, 2015, 9:28:03 PM, you wrote:

c> Hi,
c> I have similar problems. We have multiple connections to write to
c> the database and the updates are surrounded by create&release
c> savepoints. The issue is when two updates from different
c> connections try to modify the database, the second operation gonna
c> fail and it either returned database is busy or locked, while
c> another operation just keeps occupying the database lock until it
c> finishes. After the first operation finishes, the failed operation
c> (a short update) tries again with creating a new savepoint but it
c> still fails and after that any further operation cannot use the
c> database anymore and all of them fail with SQLITE_BUSY or database
c> locked. Is this because we don't create and handle savepoints
c> correct? One way to avoid the continuous abort is we use begin
c> transaction IMMEDIATE to wrap all our operations but it looks like
c> our solution is bandage. I don't know what will be the best
c> solution to solve our issue. If anyone could help answer it, I appreciate.
>> Date: Mon, 10 Aug 2015 15:40:17 +0300
>> From: dm3chip at gmail.com
>> To: sqlite-users at mailinglists.sqlite.org
>> Subject: [sqlite] Fwd: Problem with SQLite in C++. DB is BUSY (Multithread)
>> 
>> ---------- Forwarded message ----------
>> From: ??????? ??????????? <dm3chip at gmail.com>
>> Date: 2015-08-10 0:37 GMT+03:00
>> Subject: Problem with SQLite in C++. DB is BUSY (Multithread)
>> To: sqlite-users at mailinglists.sqlite.org
>> 
>> 
>> Hello!
>> I've got a problem. I'm using sqlite3 in my C++ project. In the log I've
>> got error's *DB is locked error code 5*. As I know error code 5 means, that
>> DB is busy. To solve this I started to use WAL journal mode. But it doesn't
>> help.
>> 
>> In my program I've got 2 connections to the same db. I use mutexes for both
>> DB connections.
>> I'm opening connections with this code:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> *if (sqlite3_open_v2(db_path.c_str(), &this->db, SQLITE_OPEN_READWRITE |
>> SQLITE_OPEN_CREATE | SQLITE_OPEN_NOMUTEX, 0) ) {
>> LOG4CPLUS_FATAL(this->logger, "Can not open/create DB " <<
>> sqlite3_errmsg(db));    sqlite3_close(this->db);}if (sqlite3_exec(this->db,
>> "PRAGMA journal_mode = WAL;", 0, 0, &err)) {
>> LOG4CPLUS_ERROR(this->logger, "SQL det journal mode error: " << err);
>> sqlite3_free(err);}*
>> 
>> First connection is used for inserting data to the DB. It happens with 4
>> time every second.
>> Second connection is used for starting transaction, selecting, updating,
>> deleting data and committing. It happens every 5 seconds.
>> 
>> I'm getting errors from the first connection.
>> 
>> Please help me to solve this problem.
>> 
>> P.S. Sorry for my bad English
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users at mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
c>                                           
c> _______________________________________________
c> sqlite-users mailing list
c> sqlite-users at mailinglists.sqlite.org
c> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



-- 
 Teg                            mailto:Teg at djii.com

Reply via email to