-->
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.  [ 2 posts ] 
Author Message
 Post subject: Unneccessary connections
PostPosted: Wed Feb 08, 2017 8:05 am 
Newbie

Joined: Thu Jan 19, 2017 6:40 am
Posts: 3
Hi, i have a large application and am currently logging Hibernate statistics for some performance analysis and keep getting the following entry popping up:

2017-02-07 15:10:02,738 [http-nio-8181-exec-2] INFO org.hibernate.engine.internal.StatisticalLoggingSessionEventListener - Session Metrics {
887587 nanoseconds spent acquiring 1 JDBC connections;
0 nanoseconds spent releasing 0 JDBC connections;
0 nanoseconds spent preparing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC statements;
0 nanoseconds spent executing 0 JDBC batches;
0 nanoseconds spent performing 0 L2C puts;
0 nanoseconds spent performing 0 L2C hits;
0 nanoseconds spent performing 0 L2C misses;
0 nanoseconds spent executing 0 flushes (flushing a total of 0 entities and 0 collections);
0 nanoseconds spent executing 0 partial-flushes (flushing a total of 0 entities and 0 collections)
}

When certain actions are performed this can appear up to 200 times, where it acquires a connection but no statements or anything are executed. I have one page that shouldn't use Hibernate at all yet when loading up 40 of these log messages appear.

Initially i thought it could be from a lot of @Transactional methods that weren't actually performing any action on the database, but this doesn't appear to be the issue at first glance.

My question is simply what could be causing for all of these log messages to be showing up and what to look for so that i can prevent it, as it is a needless 200ms spent loading certain pages. I have read that it could be something around the connection pooling but my knowledge on this area isn't very good, so any further explanation would be appreciated if this is the issue.

Thanks


Top
 Profile  
 
 Post subject: Re: Unneccessary connections
PostPosted: Wed Feb 08, 2017 10:45 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
I think it's from the connection pool, in case you have a minimum connection size. Another explanation is that during application bootstrap, a connection is needed to load the DB metadata. It might be that connection you're seeing.


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

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.