Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
[b]Hibernate version:3.2.5[/b]
[b]Name and version of the database you are using: Postgresql 8.1.3 [/b]
Am actually developing a web-application. Clients are calling a simple jsp page in which there is a simple query.
Here is my query:
Session session = HibernateUtil.currentSession();
session.connection().setAutoCommit(true);
return (ClassA)session
.createQuery("FROM ClassA p where p.code= :code and p.isDeleted = false")
.setCacheable(true)
.setString("code", code)
.uniqueResult();
My problem is that when many clients (100 or more) are calling this page AT THE SAME TIME, the query takes a very very long time to be executed. Normally it takes about 100ms but when there is a load each call to this query takes about 15sec or more to be executed. As if there is a ReadExclusiveLock. What I want is an AccessSharedLock.
I don't want client to wait for the first call to finish before executing the query. I want concurrent access. How can I achieve this?
Thanks in advance
Read this:
http://hibernate.org/42.html