-->
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: Strange and simple
PostPosted: Sun Oct 26, 2014 1:58 pm 
Newbie

Joined: Sun Oct 26, 2014 1:44 pm
Posts: 1
I am new on using Hibernate and have a really strange behaviour on a really simple java console program.
I use c3p0-0.9.2.1 as cache.
My Db is the usual Employee on Mysql and I write two similar queries:

1 )
Query hibernateQuery = session.createQuery("from Employees");
java.util.List lista = hibernateQuery.list();

the query is fast but the list operation is really slow.

2)

java.util.List lista = session.createCriteria(Departments.class).list();

is fast

Why it happen ?
Maybe this is a simple question but I don't find any suggestion on internet to help me to understand.
Thanks for the help


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.