2 Replies Latest reply on Jul 23, 2007 8:30 AM by Santosh Maskar

    Exception while Storing Event in Database : Could not get JD

    Santosh Maskar Newbie

      I am persisting data into the MSSQL Server 2005 database using the JNDI lookup. I can insert the single record at a time, but when I ran the test program for 10 or 20 records i am getting the following exception on Jboss

      Configuration details : JBoss, Spring, MSSQL server 2005, Jdk 5

      JNDI mapping from JBOSS

      <?xml version="1.0" encoding="UTF-8"?>


      <local-tx-datasource>
      <jndi-name>jdbc/miramar</jndi-name>
      <!-- allows DS to be accessed remotely -->
      <use-java-context>false</use-java-context>
      <connection-url>jdbc:inetdae7:localhost:1434?database=miramar&amp;secureLevel=0</connection-url>
      <driver-class>com.inet.tds.TdsDriver</driver-class>
      <user-name>sa</user-name>
      admin123
      <min-pool-size>5</min-pool-size>
      <max-pool-size>50</max-pool-size>

      <type-mapping>MS SQLSERVER2000</type-mapping>

      </local-tx-datasource>




      Exception :

      14:07:06,812 INFO [myMDB] Exception while Storing Event in Database : Could not get JDBC Connection; nested exception is org.jboss.util.Neste
      dSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset); - neste
      d throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.S
      ocketException: Connection reset))
      14:07:06,812 INFO [STDOUT] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava
      .net.SocketException: Connection reset); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (co
      m.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset))
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:107)
      14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
      14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
      14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:177)
      14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:356)
      14:07:06,812 INFO [STDOUT] at com.org.project.gen.MyDAOImpl.insert(MyDAOImpl.java:25)
      14:07:06,812 INFO [STDOUT] at com.org.project.geo.MyTabletDAO.addEvent(MyTabletDAO.java:137)
      14:07:06,812 INFO [STDOUT] at com.org.project.mdb.myMDB.onMessage(myMDB.java:72)
      14:07:06,812 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
      14:07:06,812 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:07:06,812 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
      14:07:06,812 INFO [STDOUT] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:87)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1090)
      14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
      14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
      14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567)
      14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963)
      14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._run(TibjmsSession.java:3054)
      14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession.run(TibjmsSession.java:4204)
      14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
      14:07:06,812 INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
      14:07:06,812 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
      14:07:06,812 INFO [STDOUT] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.
      SocketExceptionjava.net.SocketException: Connection reset)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
      java:161)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnection
      Pool.java:508)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534
      )
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:395)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:297)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:447)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManage
      r2.java:874)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
      14:07:06,812 INFO [STDOUT] ... 33 more
      14:07:06,812 INFO [STDOUT] Caused by: com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset
      14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createSQLException(Unknown Source)
      14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
      14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
      14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.(Unknown Source)
      14:07:06,812 INFO [STDOUT] at com.inet.tds.q.(Unknown Source)
      14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createConnection(Unknown Source)
      14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsDriver.connect(Unknown Source)
      14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
      java:151)
      14:07:06,812 INFO [STDOUT] ... 41 more

        • 1. Re: Exception while Storing records in Database : Could not
          Santosh Maskar Newbie

           

          "smaskar" wrote:
          I am persisting data into the MSSQL Server 2005 database using the JNDI lookup. I can insert the single record at a time, but when I ran the test program for 10 or 20 records i am getting the following exception on Jboss

          Configuration details : JBoss, Spring, MSSQL server 2005, Jdk 5

          JNDI mapping from JBOSS

          <?xml version="1.0" encoding="UTF-8"?>

          <datasources>
          <local-tx-datasource>
          <jndi-name>jdbc/miramar</jndi-name>
          <!-- allows DS to be accessed remotely -->
          <use-java-context>false</use-java-context>
          <connection-url>jdbc:inetdae7:localhost:1434?database=miramar&secureLevel=0</connection-url>
          <driver-class>com.inet.tds.TdsDriver</driver-class>
          <user-name>sa</user-name>
          <password>admin123</password>
          <min-pool-size>5</min-pool-size>
          <max-pool-size>50</max-pool-size>
          <metadata>
          <type-mapping>MS SQLSERVER2000</type-mapping>
          </metadata>
          </local-tx-datasource>
          </datasources>



          Exception :

          14:07:06,812 INFO [myMDB] Exception while Storing Event in Database : Could not get JDBC Connection; nested exception is org.jboss.util.Neste
          dSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset); - neste
          d throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava.net.S
          ocketException: Connection reset))
          14:07:06,812 INFO [STDOUT] org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.SocketExceptionjava
          .net.SocketException: Connection reset); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (co
          m.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset))
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:107)
          14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:112)
          14:07:06,812 INFO [STDOUT] at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
          14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:177)
          14:07:06,812 INFO [STDOUT] at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:356)
          14:07:06,812 INFO [STDOUT] at com.org.project.gen.MyDAOImpl.insert(MyDAOImpl.java:25)
          14:07:06,812 INFO [STDOUT] at com.org.project.geo.MyTabletDAO.addEvent(MyTabletDAO.java:137)
          14:07:06,812 INFO [STDOUT] at com.org.project.mdb.myMDB.onMessage(myMDB.java:72)
          14:07:06,812 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor68.invoke(Unknown Source)
          14:07:06,812 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          14:07:06,812 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
          14:07:06,812 INFO [STDOUT] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:475)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:87)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:94)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:389)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1090)
          14:07:06,812 INFO [STDOUT] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
          14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
          14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._submit(TibjmsSession.java:3567)
          14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._dispatchAsyncMessage(TibjmsSession.java:1963)
          14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession._run(TibjmsSession.java:3054)
          14:07:06,812 INFO [STDOUT] at com.tibco.tibjms.TibjmsSession.run(TibjmsSession.java:4204)
          14:07:06,812 INFO [STDOUT] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
          14:07:06,812 INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
          14:07:06,812 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
          14:07:06,812 INFO [STDOUT] Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.inet.tds.r: java.net.
          SocketExceptionjava.net.SocketException: Connection reset)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
          java:161)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnection
          Pool.java:508)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:207)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534
          )
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:395)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:297)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:447)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManage
          r2.java:874)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:103)
          14:07:06,812 INFO [STDOUT] ... 33 more
          14:07:06,812 INFO [STDOUT] Caused by: com.inet.tds.r: java.net.SocketExceptionjava.net.SocketException: Connection reset
          14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createSQLException(Unknown Source)
          14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
          14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.a(Unknown Source)
          14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsConnection.<init>(Unknown Source)
          14:07:06,812 INFO [STDOUT] at com.inet.tds.q.<init>(Unknown Source)
          14:07:06,812 INFO [STDOUT] at com.inet.tds.k.createConnection(Unknown Source)
          14:07:06,812 INFO [STDOUT] at com.inet.tds.TdsDriver.connect(Unknown Source)
          14:07:06,812 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.
          java:151)
          14:07:06,812 INFO [STDOUT] ... 41 more



          • 2. Re: Exception while Storing Event in Database : Could not ge
            Santosh Maskar Newbie

            Problem was resolved. It was related to admin user since it has only one dedicated connection, cant create multiple connections (MSSQL server 2005 developer edition). Using a new user I can insert the data into the database.

            Thanks,
            Santosh Maskar