Discussion:
[jboss-user] [Datasource Configuration] - How to fix ERROR [STDERR] (pool-152-thread-1660) com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. in jboss 6.1
Ankit Pandey
2013-06-17 07:47:09 UTC
Permalink
Ankit Pandey [https://community.jboss.org/people/ankit.pandey] created the discussion

"How to fix ERROR [STDERR] (pool-152-thread-1660) com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. in jboss 6.1"

To view the discussion, visit: https://community.jboss.org/message/823389#823389

--------------------------------------------------------------
Hi,


I am connecting SQLServer but sometimes I got


2013-06-17 12:56:00,068 ERROR [STDERR] (pool-152-thread-1660) com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
2013-06-17 12:56:00,070 ERROR [STDERR] (pool-152-thread-1660)           at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
2013-06-17 12:56:00,070 ERROR [STDERR] (pool-152-thread-1660)           at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(SQLServerConnection.java:319)
2013-06-17 12:56:00,070 ERROR [STDERR] (pool-152-thread-1660)           at com.microsoft.sqlserver.jdbc.SQLServerConnection.prepareStatement(SQLServerConnection.java:1839)
2013-06-17 12:56:00,070 ERROR [STDERR] (pool-152-thread-1660)           at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConne..................




My Jboss Configuration is


          <local-tx-datasource>
        <jndi-name>jdbc/abc.008</jndi-name>
        <connection-url>jdbc:sqlserver://ip:2499;databaseName=DB</connection-url>
        <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
        <user-name>sa</user-name>
        <password>pass</password>
          <autoReconnect>true</autoReconnect>
        <failOverReadOnly>false</failOverReadOnly>
        <maxReconnects>50</maxReconnects>
        <initialTimeout>15</initialTimeout>
          <check-valid-connection-sql>select 1 </check-valid-connection-sql>          
    </local-tx-datasource>


I have to restart JBoss for getting working connection again which is not the real possible solution obviously. I want to avoid this Jboss restart everytime..
It's very urgent...
Please Help...
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/823389#823389]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Wolf-Dieter Fink
2013-06-18 06:03:41 UTC
Permalink
Wolf-Dieter Fink [https://community.jboss.org/people/wdfink] created the discussion

"Re: How to fix ERROR [STDERR] (pool-152-thread-1660) com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. in jboss 6.1"

To view the discussion, visit: https://community.jboss.org/message/823586#823586

--------------------------------------------------------------
Have a look to https://community.jboss.org/docs/DOC-9328 https://community.jboss.org/wiki/configdatasources

How your connection are failing? Are all connections are invalid, fast-fail might help? You might use the JMX console (see Datasource pools) and invoke flush, in this case the connections are closed and the pool is new created.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/823586#823586]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Ankit Pandey
2013-06-18 13:26:24 UTC
Permalink
Ankit Pandey [https://community.jboss.org/people/ankit.pandey] created the discussion

"Re: How to fix ERROR [STDERR] (pool-152-thread-1660) com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed. in jboss 6.1"

To view the discussion, visit: https://community.jboss.org/message/823681#823681

--------------------------------------------------------------
Thanks for your reply,

Actually, When I got this exception I have a non-working connection object i.e. I got connection successfully but when I try to use it, throws above exception.
In this case, I need to restart JBoss...

I don't know how to avoid JBoss Restart after I got this exception and got and working connection again..
Please Help...
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/823681#823681]

Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2077]
Loading...