AnsweredAssumed Answered

Ibatis exception

Question asked by luisalves00 on Aug 14, 2011
Latest reply on Aug 15, 2011 by luisalves00
I'm getting this exception:

Caused by: org.apache.ibatis.transaction.TransactionException: Error configuring AutoCommit.  Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false.  Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 46.810.842 milliseconds ago.  The last packet sent successfully to the server was 46.810.842 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
   at org.apache.ibatis.transaction.jdbc.JdbcTransaction.setDesiredAutoCommit(JdbcTransaction.java:47)

This happens since I changed the way to config activiti.
At first I was using the properties file. Now I use a programmatic configuration as in the next code block.


public static void initActiviti() {
        try {
            //ProcessEngines.init();

            ProcessEngine processEngine = ProcessEngineConfiguration
                    .createStandaloneProcessEngineConfiguration()
                    .setJdbcUrl(ApplicationConfig.getConfigParam("activiti.url"))
                    .setJdbcDriver(ApplicationConfig.getConfigParam("activiti.driverClassName"))
                    .setJdbcUsername(ApplicationConfig.getEncryptedConfigParamDecrypted("activiti.username"))
                    .setJdbcPassword(ApplicationConfig.getEncryptedConfigParamDecrypted("activiti.password"))
                    .setJdbcMaxActiveConnections(Integer.parseInt(ApplicationConfig.getConfigParam("activiti.jdbcMaxActiveConnections")))
                    .setJdbcMaxIdleConnections(Integer.parseInt(ApplicationConfig.getConfigParam("activiti.jdbcMaxIdleConnections")))
                    .setDatabaseType(ApplicationConfig.getConfigParam("activiti.databaseType"))
                    .setDatabaseSchemaUpdate(ApplicationConfig.getConfigParam("activiti.databaseSchemaUpdate"))
                    .setHistory(ApplicationConfig.getConfigParam("activiti.history"))
                    .setProcessEngineName(ACTIVITI_ENGINE_NAME)
                    .buildProcessEngine();

            ProcessEngines.registerProcessEngine(processEngine);

//do deployments here
} catch (Exception e) {
            logger.log(Priority.FATAL, "Couldn't initialize Activiti Engine ", e);
        }

config params


<context-param>
        <param-name>activiti.url</param-name>
        <param-value>jdbc:mysql://localhost:3306/activiti?autoReconnect=true</param-value>
    </context-param>
    <context-param>
        <param-name>activiti.driverClassName</param-name>
        <param-value>com.mysql.jdbc.Driver</param-value>
    </context-param>

  ….

How to fix this? is this an ibatis issue or activiti?

Outcomes