Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection not released

 
Brajendra Mathema
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi , i am new to ejb and using glassfishv2 in my j2ee project(jsf/ejb/hibernate/mssql/oracle), i have database connection pooling setup using glassfish admin consol, i have a single stateless session bean which uses mssql through persistent context and oracle through @resource annotation..after certain period i am not getting connection to mssql as all the connection get occupied..
does stateless ejb occupies the connection when each instance is created and retains it...even if so ...isn't it the instance should be reused wihtout giving connection not availabe...help needed urgently
thanks ..
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Greenhorn!

I guess my big questions is how are you releasing the connections back to the pool? Is the stateless session bean, SLSB, calling a close method on the connection when it's done, or is it just hanging onto it? Is this more prevalent under peak load, or is it just a matter of time for the problem to occur?

Do you have a small stack tract (small, not all of it, just the important top part) or some code we could see (just a snippet, not the entire application) to give us some hints on where the problem might be, or what might be causing it?

Are there any settings in your pool that you've left out, or given high values to? Something like that might help us help you.

-Cameron McKenzie


 
Brajendra Mathema
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cameron, thankyou very much for quick reply,

actually i am not getting connection from mssql database
i am not closing the connection explicitly using @remove annotation, i thought application server(glassfish) itself manages the connection closing,

for mssql i have configured from glassfish admin console as:
i have set the initial pool size:100 and max pool size:200 and not getting any stack trace exception except message like no connection available

and when i monitor the resource i see all the connection consumed i.e all the 200 connection is in used and not released ,

i have set the ideal timeout 300s and pool resize quantity : 50

and also i want to know that when database connection is used using @resource annotation, as each instance is created for stateless session bean does it acquire the connection too or just prepares for getting connection

thankyou
-brajen
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic