question

hungrydba avatar image
hungrydba asked

MS SQL server query -- Please help ---

Hello All

We have an application which connects to the sql server database ( Always on cluster ) through a JDBC connection and this gets the following errors at times .. There are no corresponding errors or alerts seen at the sql server error logs..

How do we approach this problem ? Any pointers will be appreciated ..

============================================================

The connection is closed.

com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:388)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.getMetaData(SQLServerConnection.java:2026)

at psdi.server.ConRef.getMetaData(ConRef.java:819

======================================================================

Many Thanks

sql-server-2008sql server 2012sql server 2014connectionerrors
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Magnus Ahlkvist avatar image
Magnus Ahlkvist answered

Did you have failover on the cluster at the time or just before the time of these errors? You don't say if it's an always on availability group or a failover cluster instance, but it shouldn't make a huge difference.
If you didn't have a failover just before these errors, you might have had a short network glitch causing the connection to close. If you have connection pooling, it might be worth investigating if there's a way in the pool-software to check connection status and reconnect if needed when handing connection to the calling application.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeff Moden avatar image
Jeff Moden answered

Another thing to check for is if the database is set to auto close.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.