hi there,
I face one problem working with MS SQL 2000 and JDBC.
It is one web application, everything is working fine, I just have problem with one big report.
There is one servlet, which executes about 250 sql statements (selects and inserts), when its run several times after another, I get this error:
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at ObjectBase.JConnection.<init>(JConnection.java:45)
Its allways different, sometimes it takes 5 executions to get that error, sometimes 7 or 10.
When the error occurs, every servlet (even other part from the application with 1 sql statement) trying to connect to this SQL Server gets this error. It takes a few minutes after which this error does not come, it looks like a timeout.
I looked at the MS SQL Server / Process Info, there you can see the number of processes growing up to about 1500 and than decreasing to 300 and growing again, while the reports are running
I execute the sql statements like this:
//create connection
Connection m_oConnection;
Class.forName(properties.getProperty("SQLDRIVER")); // MSSQLServer JDBC Driver
m_oConnection = DriverManager.getConnection(dbUrl,user,password); // PostgreSQL, MySQL
//execute sql
m_oConnection.createStatement().executeQuery("select * from table");
m_oConnection.createStatement().executeUpdate("insert into table...");
If some has any idea how I can avoid this problem, pleas let me know,
thanks in advance.