Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-12-04 Thread Pavel Ivanov
Never use signal handlers to call sqlite3_* functions. Your handler can be called while another sqlite3_* call is in process but sqlite3_* functions are not re-entrant, so such code will lead to any kind of bizarre behavior (including any sort of segmentation fault). Use your signal handler to set

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-12-04 Thread liubin liu
Thank you I do the job as you say, but the problem is still here. There are several processes who write the database. And the place is not same each time that the problem happens. How could I know the reason exactly? PS: I used the signal to close the connection to database. Just like:

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-12-04 Thread liubin liu
I do the job as you say, but the problem is still here. There are several processes who write the database. And the place is not same each time that the problem happens. How could I know the reason exactly? PS: I used the signal to close the connection to database. Just like: int main () {

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-12-03 Thread liubin liu
PS: I used the signal to close the connection to database. Just like: int main () { ... signal (SIGUSR2, (void*)sig_handler); } void sys_sig_handler(int sig) { ... switch(sig) { case SIGUSR2: ... sqlite3_close (db); ...

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-12-03 Thread liubin liu
I do the job as you say, but the problem is still here. There are several processes who write the database. And the place is not same each time that the problem happens. How could I know the reason exactly? Pavel Ivanov-2 wrote: > >> Because there are several process who use the database. I

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-11-30 Thread Pavel Ivanov
> Because there are several process who use the database. I have another > question:Could I close the database of other process in main process? Just use your favorite IPC mechanism and write your application so that main process sends message to other process and when other process receives it

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-11-29 Thread liubin liu
Thank you! I'm sorry for not showing clearly the environment is embedded linux on arm board. Because there are several process who use the database. I have another question:Could I close the database of other process in main process? Nick Shaw-3 wrote: > > By "other process" do you mean a

Re: [sqlite] sqlite3 is blocked by transaction when wanting to close the sqlite3 *

2009-11-26 Thread Nick Shaw
By "other process" do you mean a separate DLL or similar? You can't free memory allocated in a DLL from an application, even when that application has the DLL loaded - Windows will complain. This could be what's happening. Could you instead write the database close call within this other