-->
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.  [ 8 posts ] 
Author Message
 Post subject: Performance issue for SessionImpl.get
PostPosted: Tue Oct 06, 2009 7:25 am 
Newbie

Joined: Sat Oct 11, 2008 12:48 pm
Posts: 5
Hi all,

I am facing a J2EE application problem when using hibernate. Here are my program version.
hibernate3.2.5
WAS6.1.0.23
spring2.0.6
Java1.5

We experience long response time for the SessonImpl.get method at random time and random server. We have seen it several times and eliminate the problem from DB/network, as only some of the servers (in random) having the same functions experience the problem.

After tracing more, the long response time is from "DefaultLoadEventListener.onLoad" method everytime. Do anyone experience the same problem before and how to solve it? Thanks for all that can help.

Code:
SessionImpl.get()
   SessionImpl.afterOperation()      
   SessionImpl.fireLoad()
   -> SQL call   
       DefaultLoadEventListener.onLoad()
       -> SQL call
           Log4JLogger.info()
           SessionImpl.checkTransactionSynchStatus()
           SessionImpl.fireLoad()
   EventListeners.getLoadEventListeners()      
   SessionImpl.checkTransactionSynchStatus()


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Tue Oct 06, 2009 7:39 am 
Newbie

Joined: Wed Sep 30, 2009 2:04 am
Posts: 5
May be session get generates big SQL queries? You can see queries, by setting show_sql = true.


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Tue Oct 06, 2009 10:59 am 
Newbie

Joined: Sat Oct 11, 2008 12:48 pm
Posts: 5
No, the SQLs is only small SQL and it is find by ID only. The table only has small number of fields (<10 fields) and the result set is only 1. As in the code, we are using SessionImpl.get and target to get unique result by ID.
And we are using oracle 10g and using hibernate optimistic lock mechanism, so there is no issue like waiting for commit read, record lock, etc.


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Tue Oct 06, 2009 1:28 pm 
Newbie

Joined: Wed Sep 30, 2009 2:04 am
Posts: 5
I don't know about your problem. You can use database profiler. First step - find where problem: on database or on your application?


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Tue Oct 06, 2009 11:10 pm 
Newbie

Joined: Sat Oct 11, 2008 12:48 pm
Posts: 5
Thanks for your prompt response. As said in the first post, we have already eliminate the possibility from DB/network. As the same SQL retrieving the same amount of data is performed at every server, but only some of them has problem, and in different server in random. If that sql has problem, it should happen everytime. If it is the db/network problem at that particular moment, all servers should experience the same, but it is not the case. So, the problem is on the application server its own.


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Mon Aug 09, 2010 6:10 am 
Newbie

Joined: Thu Aug 05, 2010 4:37 am
Posts: 2
Hi all, I've got the same issue on our production system. We have multiple application servers running the same code and pointing to the same db.
Some of the time (no specific pattern), the SessionImpl.get show high response time (>10s, which normally should complete with 0ms). Those high response time would not happen on all application servers at the same time. It seems to me that it's not DB or network induce the problem.

We have no idea what the SessionImpl.get is waiting for, is there any way or any trace I could enable to identify the problem?


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Mon Aug 09, 2010 6:37 am 
Regular
Regular

Joined: Fri Aug 06, 2010 1:49 am
Posts: 102
Location: shynate26@gmail.com
hi iswhchong,

There is a subtle difference betweenget() and load().

If you just used session.load() instead of get(), hibernate will not hit the database. Instead it will return a proxy, or an actual instance if it was present in the current session, and that can be used to serve as a reference.

_________________

Cheers!
Shynate
mailto:shynate26@gmail.com
www.CSSCORP.com


Top
 Profile  
 
 Post subject: Re: Performance issue for SessionImpl.get
PostPosted: Tue Aug 10, 2010 2:02 am 
Newbie

Joined: Thu Aug 05, 2010 4:37 am
Posts: 2
Hi Shynate, thx for your prompt reply.
For that get() method we used, it's underlying table is very small and we are getting it by id. > 99% of the time the response time is 0ms from our monitoring tools (wily introscope). Occasional spike would be ~10sec, spike would happen in our application servers farm, but not at the same time and have no pattern.
We have no clue to explain those spike and see if you have any idea


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.