• 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Multiple Datasource declaration in tomcat context.xml

 
Ranch Hand
Posts: 103
jQuery Netbeans IDE Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I need to have multiple connection pools in my application. As I am using Tomcat 8.x , I have decided to use the tomcat container for managing my data sources.
For this I made multiple entries in context.xml for Resource tag



And for getting connection I look up the context and all DataSources present in the context.
I save all datasources in a Map<String,DataSource> and able to create connection with each datasource.

I am confused that if I call close on the retrieved connection , Will it be returned to the pool from which it was fetched ? Or It will be lost?
What will happen to such Connection object?


Please guide me.

Thanks in advance.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!