flushing database cache in SWI-Prolog

Posted by JPro on Stack Overflow See other posts from Stack Overflow or by JPro
Published on 2010-03-20T10:41:22Z Indexed on 2010/03/20 14:01 UTC
Read the original article Hit count: 624

Filed under:
|

We are using swi-prolog to run our testcases. Whenever the test starts, I am opening the connection to MYSQL database and storing the Name of the Test hat is being done and then closing the DB. These tests run for about 2 days continuously. After the tests are done, the results basically gets stored in folder in the server. There is a predicate in another prolog file that is called to update the results to the MYSQL database. The code is simple, I use odbc library and just call odbc_* predicates to connect and update the mysql by issuing direct queries.

The actual problem is :

  1. If I try to call the Predicate from the same Prolog window, where the test just got completed, I get an error as updating to the DB server. Although I do not get any error in the connection. If I close the session of that prolog with halt and closing all the open prolog windows , then open an other complete new instance of Prolog and run the predicate the update goes well.

I have a feeling that there is some connection reference to the MySQL DB in Prolog database. Is there any way to clear the database in prolog so that I can run the same predicate without closing any existing prolog windows?

Any ideas appreciated.

Thanks.

© Stack Overflow or respective owner

Related posts about swi-prolog

Related posts about mysql