File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Connection Pooling Doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Pooling Doubt" Watch "Connection Pooling Doubt" New topic
Author

Connection Pooling Doubt

Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi Ranchers,

Have a doubt this time on JDBC Connection pooling. I have an application which connects to JDBC via a DSN named jdbc/FCRDSN created in Websphere App Server 5.1 and the connection timeout by default has been set to 180(seconds), the problem comes when this timeout reaches and my application throws a StaleConnectionException. I have browsed internet , however did not get satisfactory answers.

What i did for Solution : Increased the timeout which is 180 to 1800, which i thought would be good 30 minutes, but it doesnt happen the way i expected and it still throws the above said Exception.

Requirement : I am trying to find a solution to this in which i can set the connection timeout to Infinity and it wont matter much since this is my local development setup. I have read Servelts in which we can set <session-timeout> in indefinate, is there a similar kind of thing for JDBC as well ?

Thanks in advance,
Yogendra N Joshi.


Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are you closing connections when you are finished with them? A connection that is in use will not time out.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Paul Sturrock wrote:Are you closing connections when you are finished with them? A connection that is in use will not time out.


Hi Paul,

thanks for your reply. Actually what happens is the software (WAS 5.1 ) which i am using was a trial version and it has expired now and whenever i want to use it i need to backdate my computer system time. WHen i do that my it works fine.

After sometime, according to the company local policy, my system date again becomes today's date and henceforth if i try using it, it fails with StaleConnectionException

IS there a way out to it ?

Yogendra
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

No. If you are hacking round licence restrictions to use software illegally then you are kind of stuck. Any reason you can't just buy a valid licence?
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi Paul,

Well... I am a novice developer learning java for my career and i just do with something which i have. I cannot buy it coz WAS6.1 from IBM definitely would be costlier then my monthly salary

Any other idea ?

Yogendra
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30908
    
158

Yogendra Joshi wrote:Any other idea ?

1) Get your company to pay for a valid license
2) Use JBoss (which is free)


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Pooling Doubt