3 Replies Latest reply on Aug 26, 2015 3:34 AM by Lyle Wang

    Where can I add these variables on JBoss web console like validationQuery, etc?

    Kyumin Lee Newbie

      I have used MySQL, Spring, MyBatis.

      Like you know, when there is no database connection for 8 hours (default time), the database close the connection.

      And when I tried to run an application, it gives an error message like this, because a datasource has old database connections in a pool.

       

      -------------------------------------

      09:07:47,969 DEBUG [org.springframework.web.servlet.DispatcherServlet] (http-/0.0.0.0:8080-1) Could not complete request: org.springframework.transaction.TransactionSystemException: Could not commit JDBC transaction; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.

              at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:275) [spring-jdbc-4.2.0.RELEASE.jar:4.2.0.RELEASE]

              at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761) [spring-tx-4.2.0.RELEASE.jar:4.2.0.RELEASE]

              at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730) [spring-tx-4.2.0.RELEASE.jar:4.2.0.RELEASE]

              at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485) [spring-tx-4.2.0.RELEASE.jar:4.2.0.RELEASE]

              at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291) [spring-tx-4.2.0.RELEASE.jar:4.2.0.RELEASE]

              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.2.0.RELEASE.jar:4.2.0.RELEASE]

              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.2.0.RELEASE.jar:4.2.0.RELEASE]

      -------------------------------------


      So, I added to add validationQuery, testOnBorrow, testOnReturn, etc in 'Properties' tab menu of JBosss web console.

      However it did not work.


      Can you let me know where and what variables do I need to add to avoid the upper error?

      I don't use autoReconnect option.