Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection Problems 1

Status
Not open for further replies.

javoine

Programmer
May 22, 2003
25
US
Greets,

I don't know if this should be in this(Tomcat) section or the JSP area, but here goes...

I have a simple web application using 2 java classes to access connection information.

I call the classes from a JSP page and establish my connection.

Then, I close my connections and any statements/recordsets, etc...

BUT: when only 1 page is testing it, it appears to work fine and eventually connections close, but when multiple user have used the app, the connections wont die?

how do kill all my connections when no one else is using the app?

thanx in advance for any info you might have
 
Are you using a connection pool ?
Are you attempting to use concurrent data requests on the same Connection ?
 
sedj,

faithful hero, glad to see you here. yes, although i do not have control over this database (postgres), I was told that we are using a connection pool.

In other products that I have used, the connection pool will kill the connection after some said timeout period,

in this case though, when multiple users have the page, it creates new simultaneous connections and they seem to remain open to the point where tomcat needs to be restarted in order to free the connections to the database.

any suggestions are welcome...thanx
...
 
And you definitely close the ResultSet, Statement/CallableStaement and Connection objects ?

If so, try to monitor the state of the connections db side, and add debug code to make sure you are definitely closing all db-related objects and connections.

What drivers are you using ?
 
i am absolutely positive that i close all my objects. i dont really have that many, but i do close each one.

the driver i am using is: jdbc:postgresql

jdbc uses connection pooling, but does not kill the connections after a time limit, so they remain open to the server database, i am taking your suggestion and trying to monitor and debug, if you have any other suggestions, please feel free...and thank you again as always!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top