On Jul 4, 2009, at 8:12 PM, Wenton Thomas wrote: > I use prepare statements, and I am sure I finalize all of them.
You may be mistaken. sqlite3_next_stmt() will return 0 if all statements really are finalized. assert( sqlite3_next_stmt(db, 0)==0 ); Dan. > > > > > > ________________________________ > From: Igor Tandetnik <itandet...@mvps.org> > To: sqlite-users@sqlite.org > Sent: Saturday, July 4, 2009 8:44:52 PM > Subject: Re: [sqlite] problem with SQLITE_BUSY > > Wenton Thomas wrote: >> 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. > > How precisely do you implement "insert all records" part? Do you use > prepared statements, by any chance? If so, you need to finalize all > such > statements before you can close the connection. > > Igor Tandetnik > > > > _______________________________________________ > 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 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users