-->
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: Does performance issue for each request getting the session
PostPosted: Tue Sep 09, 2014 2:55 am 
Newbie

Joined: Thu Sep 22, 2011 9:06 am
Posts: 16
Team,
I need a clarification about session performance. I have created session pool(LocalSessionFactoryBean). I mean for each thread request I am getting a session(not created new one) from pool. For each request(from controller to serviceImpl), I am getting a session and once request is completed I just close the session. In this case, I feel session(currentSession and close session) is cause of performance issue for following ways. Please suggest me, which way is best in this situation.

#WAY 1:
=======
TestController.java
-------------------------
for (String sdgCode : sdgCodes) {
//For each sdgCode, I am calling serviceImpl
// As per my knowledge, We are getting a session / close the session for each service request
for (Feature sdgFeature : planService.getSharedDataGroupsFeature(sdgCode)) {

}
}

#WAY 2:
=======
TestController.java
------------------------
//One serviceImpl request and get the all feature objects
//Only one session will play the role here. Only one time close the session.
List<Feature> features = planService. getSharedDataGroupsFeatures(sdgCodes);
for (Feature sdgFeature : features ){

}

Conclusion : Is it performance issue for each time getting the session from session pool and close the session for each request once request has been completed? Please suggest me…


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.