User 73ad691ca3
15-04-2013 14:05:28
Dear Chemaxon Team,
Jchem search is taking more time to search a structure from a database table. We are using "Jchem .Net API-Jchem searcher class" to search a structure.
According to the Jchem Cache Registration, Search will be faster except for the first time. But Jchem search in DotNet WCF service it is very slow.
Our Structure search Application is implemented in the following way (just an outline):
-->User will draw the structure in the Structure Editor from the Client browser. Then click the search button.
-->The request goes to the server(ASP.net Application hosted in the IIS server).
-->This will call the DotNet WCF service(SearchStructure WebMethod).
-->Then will call the Jchem .Net APIs for searching the structure. We are using the Jchem Searcher class to search the structure.
We are also using the Jchem Permanent Cache to increase the performance in searching. But we have doubt whether jchem is following this in searching(WCF service).
We have noticed the below issues from the Jchem - structure search:
1. Jchem structure search is taking more time to search the structure for the 1st time. Next time it is fine. But the next day it is slow (or) if we run the application next time it is very slow. we don't know the exact time for which it is taking more time.
2. Then After some time, if we do the structure search, jchem is taking more time to search.
So what we are looking is,
-->Jchem should take less time to search the structure from the structure table.
-->As we are using the Jchem .Net API & DotNet WCF services, we are looking some workflow/some sample code to perform the structure search much faster using the Jchem.
(such as initiate call from WCF service, setting license, cache registration, creating the connection handler, creating the jchem searcher object, run the jchem search, get the hits, return the results back to the WCF service.)
Please reply us regarding this ASAP.
Below is the sample code:
wcf service will call the GetCdIdsByStructure method:
public static class Searcher
{
public static int[] GetCdIdsByStructure(JChemSearchOptions searchOptions, ConnectionHandler conh, string tableName, string molStr)
{
//set license path-jchem
//-->register permanent cache
String identifier = "unique_cache_identifier";
CacheRegistrationUtil.setPermanentCacheID(identifier);
//-->register permanent cache
int[] cd_ids = null;
try
{
JChemSearch searcher = new JChemSearch();
searcher.setConnectionHandler(conh);
searcher.setStructureTable(tableName);
searcher.setSearchOptions(searchOptions);
searcher.setRunMode(JChemSearch.RUN_MODE_SYNCH_COMPLETE);
//-->to search in a new thread
JavaThread thread = new JavaThread();
thread.RunNew();
//-->to search in a new thread
searcher.setQueryStructure(molStr);
searcher.run();
cd_ids = searcher.getResults();
searcher.cleanResults(); //clean
return cd_ids;
}
catch
{
throw;
}
}
}
---------------------------------------------------------------------------------------------------
Thanks & Regards,
D. Senthil kumar vijai.