-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Simple query taking too much time on conccurent access
PostPosted: Fri Nov 30, 2007 2:38 am 
Regular
Regular

Joined: Fri Feb 25, 2005 3:02 am
Posts: 71
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.