Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

connection not released

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 needed urgently
thanks ..
author and cow tipper
Posts: 5000
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

All that thinking. Doesn't it hurt? What do you think about this tiny ad?
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic