lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maria Vazquez <maria.vazq...@dexone.com>
Subject Re: Multithreaded JdbcDataStore and CachedSqlEntityProcessor
Date Mon, 03 Oct 2011 18:09:08 GMT
When I'm debugging, if it is single threaded
CachedSqlEntityProcessor.getAllNonCachedRows is called only once, all the
rows cached and next time it requests a row it gets it from the cached data.
In the logs I see the SQL call only once.

If I use multiple threads, it calls
CachedSqlEntityProcessor.getAllNonCachedRows multiple times, so it creates a
new cache per thread.

The cache should be shared among threads and be safe, right?

Thanks!
Maria




On 10/1/11 8:00 PM, "pulkitsinghal@gmail.com" <pulkitsinghal@gmail.com>
wrote:

> What part of the source code in debug mode behaved in a fashion such as to
> make it seem like it is not thread-safe?
> 
> If it feels difficult to put into words then you can always make a small 5 min
> screencast to demo the issue and talk about it. I do that for really complex
> stuff with Jing by techsmith (free version).
> 
> Or you can put up a small and simplified test case together to demo the issue
> and then paste the link for that hosted attachment :)
> 
> Sent from my iPhone
> 
> On Sep 30, 2011, at 1:28 PM, Maria Vazquez <maria.vazquez@dexone.com> wrote:
> 
>> Hi,
>> I¹m using threads with JdbcDataStore and CachedSqlEntityProcessor.
>> I noticed that if I make it single threaded CachedSqlEntityProcessor behaves
>> as expected (it only queries the db once and caches all the rows). If I make
>> it multi threaded it seems to make multiple db queries and when I debug the
>> source code it looks like it is not thread safe.
>> Any ideas?
>> Thanks,
>> Maria
>> 


Mime
View raw message