I'm using Hibernate 3, with EHCache 1.1.
I have a server running in JBoss, which relies on Hibernate for ORM and data querying.
My server serves requests from many client applications. In some instances they all ask from the same data.
I've enabled Hibernate to cache data using the combination of query cache and EHCache.
When my server sends a query to Hibernate it checks the cache. If there is no data for that query it lauches a postgresql (which is my database server) process to execute that query. What that is happening another client may want the same data; so Hibernate once again is asked to execute the same query. Since the query has no data yet Hibernate launches another postgresql to execute the query.
It seems to me that Hibernate does not detect what queries are being executed and would hold off the same (subsequent) queries such that these same queries are not executed concurrently.
Or I haven't used the right property(ies) to configure Hibernate.
Any help is appreciated.
Thanks.
|