reload structure cache

User dfeb81947d

25-07-2005 13:01:13

Dear Support,





I have a tomcat server running with a servlet that may structures searches.


But I scheduled task to update the structure table and I checked that structures updated or added are took account for the search.


In my case it has not until I shutdown and startup again tomcat.


(I made a procedure of loading cache at startup of servlet).


According to the documentation: http://www.chemaxon.com/jchem/doc/admin/tomcat.html


I had to add
Code:
<Context path="/jchem"


docBase="<JChem home>"


reloadable="true" >


</Context>
in server.xml: do it has something to do with reloading cache?


Or do I just need to make a procedure to clean the cache and reload it after every structure table update?


like:
Code:
JChemSearch.clearCache();






thank you for your help


Kind Regards


Jacques

ChemAxon 9c0afc9aaf

25-07-2005 13:34:26

Dear Jacques,





The mentioned Tomcat instruction has nothing to do with refreshing the cache.





The cache should be automatically checked and updated at the beginning of each search operation.





You do not have to call JChemSearch.clearCache() either.


(In fact this would reload the whole cache instead of a "smart" update, which would be very ineffective)





1. How do you update the table (jcman, API, etc) ?


2. If you use UpdateHandler for this, do you call UpdateHandler.close() after the updates ?





Best regards,





Szilard

User dfeb81947d

25-07-2005 13:57:41

Dear Szilard,





I'm update the structure table using API in that way:


Code:
uh = new UpdateHandler(conh,zeMode,tablejchem,autresChamps);


while (rs.next()) {


   byte[] clob = DatabaseTools(rs,1);


   String molecule = convertByteArrayToString(clob);


   int id = rs.getInt(2);


   uh.setValuesForFixColumns(id, molecule);


   uh.execute();


}


uh.close();






Best Regards


Jacques

ChemAxon 9c0afc9aaf

25-07-2005 14:32:12

Hi,





You code seems to be OK.





So far I could not reproduce the problem.





1. If you perform a search after the update the new structures are not found , just after restart ?





2. Are there any error messages in the log file of Tomcat ?








Best regards,





Szilard

User dfeb81947d

28-07-2005 14:55:40

Dear Szilard,
Szilard wrote:
1. If you perform a search after the update the new structures are not found , just after restart ?
If I restart Tomcat, the new structures are found.


But without restarting tomcat, sometimes, the new structures imported in the structure table are present, but are not found by the Servlet.
Szilard wrote:
2. Are there any error messages in the log file of Tomcat ?
there are no error, neither in Tomcat nor in Oracle.


It can be a problem with JDBC's driver whose version is recent (9.2.0.5) for Oracle 9.2.0.1





Indeed it doesn't matter since I will include the shutdown and restart of tomcat in the process of import of new Molecules.





Thank you very much.


Jacques

ChemAxon 9c0afc9aaf

29-07-2005 09:38:27

Hi,





It you happen to find out some difference between successful and unsuccessful cache updates please let me know.





This feature works well for other clients, so it's probably a rare configuration / environment issue.





Best regards,





Szilard