[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2313) Please Help me: The Perfomance of Hibernate3 Query is very poor, Special in multi thread

wang.chungang (JIRA) noreply at atlassian.com
Sat Dec 16 23:03:04 EST 2006


Please Help me: The Perfomance of Hibernate3 Query is very poor, Special in multi thread
----------------------------------------------------------------------------------------

         Key: HHH-2313
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2313
     Project: Hibernate3
        Type: Bug

    Versions: 3.1.3    
 Environment: Hibernate 3.1.3+MySQL5.1+Tomcat
    Reporter: wang.chungang
 Attachments: Noname2.txt

Where using Hibernate3 as my P-O layer,  I had found the performance of Query is very poor, special in multi thread.what can i do?

I just see The All Thread is waiting soming,  The Attachment is my execute logs.

My Code is:
String sHql = "from "+UzionDocumentPhoto.class.getName()+" WHERE publictype=:iPublicType ORDER BY id desc";
		Session session = null;
		try{
			System.out.println(Thread.currentThread()+":start open session["+System.currentTimeMillis()+"]");
			session = HibernateUtil.openSession();
			System.out.println(Thread.currentThread()+":End open session["+System.currentTimeMillis()+"]");
			Query query = session.createQuery(sHql);
			query.setInteger("iPublicType", IPhotoConstants.PHOTO_PUBLICTYPE_PUBLIC);
			query.setFirstResult(iStart);
			if(iSize>0) query.setMaxResults(iSize);
			System.out.println(Thread.currentThread()+":Before Execute["+System.currentTimeMillis()+"]");
			List retList = query.list();
			System.out.println(Thread.currentThread()+":End Execute["+System.currentTimeMillis()+"]");
			return retList;
		}
		catch(Exception ex){
			throw ex;
		}
		finally{
			HibernateUtil.closeSession(session);
		} 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list