-->
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: who can help me about Statistics
PostPosted: Wed Dec 19, 2007 10:27 pm 
Newbie

Joined: Wed Dec 19, 2007 10:15 pm
Posts: 3
I am a Chinese and please excuse for my poor English.this is my first time using Interface Statistics.My code is following:
========================================
SessionFactory sf = HibernateUtil.getSessionFactory();
Statistics s = sf.getStatistics();
s.logSummary();//all items listed are "0"
Session session = sf.openSession();
SessionStatistics ss = session.getStatistics();
Transaction tx = session.beginTransaction();
User user = new User("ZhangJP");
session.save(user);
tx.commit();
//Print "1"
System.out.println(ss.getEntityCount());
//Print "0"
System.out.println(s.getEntityInsertCount());
session.close();
HibernateUtil.close();
========================================
My question is that why "System.out.println(s.getEntityInsertCount());" print 0 not 1?I think that the getEntityInsertCount() method return the number of entites saved by hibernate through the current SessionFactory.
Thanks!


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.