• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DataSource.getConnection() returning closed connections

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am having an application which is running on Jboss and Oracle database. I get closed connections while doing Datasource.getConnection(). here is the code

Can some one please let me know, why datasource is returning closed connections

thanks
ravi
 
Greenhorn
Posts: 10
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ravi,
can you show us the implementation of ?
that should give us some idea.
 
Rocker Jagtap
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the reply, here is code behind datasource.getConnection();
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Is this the complete snippet for the method.. as i see szDataSource is always null.... and even if its set in the class level [not visible in this snippet] its re-assigned as null again.

String szDataSource = null;
if (datasource == null) {
try {
htParms = new Hashtable();
htParms.put(Context.PROVIDER_URL, szProviderURL);
htParms.put(Context.INITIAL_CONTEXT_FACTORY, szContextFactory);
context = new InitialContext(htParms);
temp = context.lookup(szDataSource);
datasource = (DataSource) temp;
context = null;
}

Thanks!

~Gurumeet
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic