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 <thomas.wen...@yahoo.com>
To: sqlite-users@sqlite.org
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
sqlite-users@sqlite.org
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
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to