Switching Caches for Chemistry Search

User 8b97537f87

27-05-2010 12:43:09

Hi,


we are using JChemSearch for e.g. substructure searches. As we intend to serve multiple business partners, we install different databases for every partner (multi tenancy). They share the same static memory, running in the same JVM.


So when starting a new JChemSearch for another business partner, we change the db to connect to


searcher.setConnectionHandler(connectionHandler);

Unfortunately this does not affect the registered cache. Right now we are using a workaround as we


JChemSearch.clearCache();

whenever we switch the database.


What we need is a way to switch between the caches of different business partners.


Is there a way, please?


Thanks in advance


vincent

ChemAxon 9c0afc9aaf

27-05-2010 15:21:44

Dear Vincent,


I assume you are using exactly the same tale names (with the same schemas) for every client.


Unfortunately this does not affect the registered cache.




Do you mean the results are from the old table ?


I theory the cache should for that table should be re-loaded - unless the other databases were "cloned", in that case certain properties in the property table could be th same ("creationTime", "vailidityTimestamp" ) that can trick the code. 


If this is not the case please let us know your JChem version, and we will investigate this.


Of course re-loading is not the ideal solution either (speed) we will try to give an estimate when could we implement that tables with identical names from different databases would coexist in memory.


(supporting "cloned" copies W/O some manual intervention may still not be easily possible)


Until this fix a possible workaround may be to use globally unique table names.


 


Best regards,


 


Szilard

User 8b97537f87

28-05-2010 08:15:57

Thank you,  Szillard,


 


yes our tablenames in the different databases are the same right now - I will change that. The content of that tables is not cloned, so in future the cache will be able to distinguish the different contents


Greetings,


vincent

ChemAxon 9c0afc9aaf

28-05-2010 15:47:48

Hi,


 The content of that tables is not cloned, so in future the cache will be able to distinguish the different contents

Some clarification.


The content is not relevant, we cannot and do not distinguish by content alone - that would mean examining all data in every row in the table which is unrealistic for large tables.


We are using some metadata to store information about the tables. Some of these are in the property table (default name "JChemProperties"). Normally a JChem table is created by our API, and information is entered into the property table.


If you clone this property table (along with empty structure tables I presume) into an other database you will trick the system into believing that it is still dealing with the same structure table on the other connection.


If you had created everything in the new DB via the JChem API, such a mix-up would not happen.


As mentioned the cached tables would still be ejected and reloaded frequently if the tables have the same names, so using different names is advisable for better performance  anyway until we improve on this.  


 


Best regards,


 


Szilard

ChemAxon a9ded07333

07-10-2010 13:11:56

Hi Vincent,


JChem will be able to distinguish between tables in different databases with same name from version 5.4


Best regards,
Tamás