-->
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: Regarding Hibernate performance
PostPosted: Wed Jan 19, 2011 7:56 am 
Newbie

Joined: Wed Jan 19, 2011 7:36 am
Posts: 1
Hi All,

I'm working on a POC which is ment to benchmark different L2 cache options for Hibernate. For that we created a simple spring application which uses only a table. This particular table holds around 5000 rows (four columns, id as primary key). But when we fire an HQL (sessionFactory.getCurrentSession().createQuery("from Contact");)from our DAO, it takes around 38 -42 seconds to return the results, which is an unacceptable behavior. Please have a look at our code
Code:
               
                  //long start = System.currentTimeMillis();
      Query query =  sessionFactory.getCurrentSession().createQuery("from Contact");
      query.setReadOnly(true);
      query.setCacheable(true);
      long start = System.currentTimeMillis();
      List<Contact> conList =query.list();
      /* HazeleCastUtil.putIntoHazelcast(conList);*/
      long elapsedTimeMillis = System.currentTimeMillis()-start;
      // Get elapsed time in seconds
      float elapsedTimeSec = elapsedTimeMillis/1000F;
      System.out.println("============================== >>>>> " +elapsedTimeSec);



Code:
<hibernate-configuration>
   <session-factory>
      
      <!--
      For Hazle Cast-->
      
      <property name="hibernate.show_sql">true</property>
      <property name="hibernate.cache.use_second_level_cache">true</property>
      <property name="hibernate.cache.use_query_cache">true</property>
      <property name="hibernate.cache.use_minimal_puts">true</property>
      <property name="hibernate.cache.provider_class">com.hazelcast.hibernate.provider.HazelcastCacheProvider</property>
    </session-factory>

</hibernate-configuration>




Looking forward for help :)

Thanks and regards,
Sankallada


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.