Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database connetion

 
nikil shar
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
have a servlet which runs sql against an oracle 11g database with Oracle JDBC driver V9.2.0.1.0. For some reason i keep getting "connection closed" exception even when i detect closed connections in the code (see below) and re-establish a connection.
The app server which i have my connection pool set up in is glassfish V3




any suggestions as to what can be done to ensure a "valid" connection is available before running sql ?? Have tried calling the isValid() but don't think my driver supports it since i get sql exception for this method.

thanks very much.
 
Misha Ver
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nikil shar wrote:The app server which i have my connection pool set up in is glassfish V3


Perhaps you could just use "validationQuery" parameter in the connection pool setting
 
nikil shar
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey that worked. thanks a million !!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic