This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

closing connections obtained by JDBC Datasource look up  RSS feed

 
Ranch Hand
Posts: 77
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

For the first time I have configured my local JBoss 7 AS for JNDI Datasource Look up.

I blindly followed instructions given in jboss forums and it worked well for me.

But if my web application is inactive for a long time and if i try login to my application new datasource lookup is working fine.

for every login my application will make a DS lookup and jdbc connection calls are working fine. But in the next page I am using a servlet that uses one connection instance to serve all the requests. Now it is not making a new DS lookup and the old connection created during servlet instantiation is being used. So now I have to restart my server to instantiate this servlet again. I am making a ds look up call in the init method of my servlet. I thought its a good way of doing but it is causing problems if the servlet is inactive for very long time .. I guess the connection is getting closed. Do I have to create a connection everytime inside service methods instead of doing it in init() method? or I have to change something else?

Thanks in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!