2 Replies Latest reply on Sep 19, 2005 4:12 AM by riank

    JBoss restart after DB restart needed?

    e9725082

      I have a CMP entity bean and I can deploy it without any problems but when I want to redeploy it and the Database was stopped and started in the meanwhile I get always the following error below.
      I tried it with MySQL and PostgreSQL. In the datasource I added also the parameter ?autoReconnect=true but it still does not work.
      Has anyone a idea?


      11:23:22,426 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=CMPTestLocal,service=EJB
      org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (java.sql.SQLException: No operations allowed after connection closed.)
      at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:196)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.init(JDBCEntityBridge.java:143)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:420)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:353)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)

        • 1. Re: JBoss restart after DB restart needed?
          schrouf

          After database restart all JBoss cached db connections are invalid ! Therefore you have to flush the database connection pool, that is 'internally' used by your CMP entity beans (most probably DefaultDS) via JMX console. Have a look at the "jboss.jca" service section to find the correct connection pool mbean entry.

          Additionally you should also include an appropriate exception sorter entry in combination with a validconnectionsql entry into you datasource -ds.xml configuration, so JBoss removes dead connections from the pool by itself on SQL.

          sample:

          <new-connection-sql>set lock mode to wait</new-connection-sql>
          <valid-connection-sql>set lock mode to wait</valid-connection-sql>
          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.InformixExceptionSorter</exception-sorter-class-name>


          Regards
          Ulf

          • 2. Re: JBoss restart after DB restart needed?
            riank

            Hi e9725082

            Did this fix work for you?