This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes MS SQL -- JDBC -- Memory Spike -- HELP! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "MS SQL -- JDBC -- Memory Spike -- HELP!" Watch "MS SQL -- JDBC -- Memory Spike -- HELP!" New topic
Author

MS SQL -- JDBC -- Memory Spike -- HELP!

BrianD Clay
Greenhorn

Joined: Sep 17, 2004
Posts: 1
Here is the overview of the problem.

We are using WAS5.1, MS SQL with the SP3 JDBC drivers (though we were having the same problem with SP1 and SP2).

When testing our web application and running transactions that make calls through the pooled Datasource to SQL that causes an increase in SQL memory usuage. Which to a certain degree in understandable. What happens though is the memory usuage keeps increasing; as if the JDBC driver is not releasing the transaction even though we are closing Result Sets, Statements, clearing warnings, and closing the connection. We are 99.9% certain that on the Java side connections are being cleaned up and closed. Yet the memory keeps disappearing.

Has anyone else experienced this and/or found a solution to it. I feel like I am missing a configuration somewhere.

Thansks,

Brian D. Clay
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

We've had nothing but problems with MS's own drivers - they are just not very good. Try jTds. Its a little better. However - we have yet to find anything that seems good enough for our production system other than a commercial driver (Data Direct).
[ September 20, 2004: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Prashant Jain
Greenhorn

Joined: Aug 19, 2004
Posts: 29
Hi Brian!

I have this information to share with you. It just might help you. Take a look at this code.

*****************************************************
Connection conn = getConnection();
CallableStatement cal1 = conn.prepare(//something);
CallableStatement cal2 = conn.prepare(//something);
*****************************************************

What the MS Driver does is, that even though you are preparing two statements and using the same connection, it will implicitly open one more connection.And it will go on doing this for every statement.So while you close one connection,I wonder whats happening to the other ones!

You may want to verify this at SQL server end by using
exec sp_who

This is one reason why we decided not to use MS driver and went in for DataDirect. There are lots of drivers available for this.jTds is open source.

regards
Prashant Jain
prashantjainn@yahoo.com
 
wood burning stoves
 
subject: MS SQL -- JDBC -- Memory Spike -- HELP!
 
Similar Threads
any free JDBC driver for MS SQL
Tomcat service wont start - jdbc driver
JRUN 4 drops jdbc connections
MS SQL JDBC driver download
JDBC Driver for MSSQL