The two database file belongs to different modules.
A module gets records from another through interfaces, not accesses
other module's database file directly.
The following statements
sqlite3_exec( select records from cA)
sqlite3_exec("begin transaction");
insert all records into cB;
sqlite3_exec("commit transaction");
are actually
get_record_func();
sqlite3_exec("begin transaction");
insert all records into cB;
sqlite3_exec("commit transaction");
where get_record_func() is a interface of module which has database file
A.db.
The functon get_record_func() execute
"sqlite3_exec( select records from cA)".
________________________________
From: "[email protected]" <[email protected]>
To: General Discussion of SQLite Database <[email protected]>
Sent: Saturday, July 4, 2009 5:57:41 PM
Subject: Re: [sqlite] problem with SQLITE_BUSY
What about using only one connection and the ATTACH statement:
http://www.sqlite.org/lang_attach.html
Also, see the select-stmt form of the INSERT statement:
http://www.sqlite.org/lang_insert.html
Something like...
sqlite3_open database B
ATTACH DATABASE A.db AS dbA
BEGIN
INSERT INTO main.mytable(col1,...colN) SELECT col1,...colN FROM dbA.myothertable
COMMIT
DETACH dbA
sqlite3_close B.db
Cheers!
________________________________
From: Wenton Thomas <[email protected]>
To: [email protected]
Sent: Saturday, 4 July, 2009 7:31:55 PM
Subject: [sqlite] problem with SQLITE_BUSY
Now in my system I used sqlite to manage 2 database file A.db and B.db, and
each has a connection handle cA, cB.
My operation perform like this:
sqlite3_exec( select records from cA)
sqlite3_exec("begin transaction");
insert all records into cB;
sqlite3_exec("commit transaction");
All return value is normal.,but when I execute
rc = sqlite3_close(),
return value rc always be SQLITE_BUSY.
Could anyone help me?
Does the two database connection disturb each other?
I means, if there exist a reading lock on cA, can I write cB?
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
____________________________________________________________________________________
Access Yahoo!7 Mail on your mobile. Anytime. Anywhere.
Show me how: http://au.mobile.yahoo.com/mail
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users