When trying to load data inside an HSQL database, the following error is thrown:

 java.sql.SQLException: statement is not in batch mode
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCUtil.sqlExceptionSQL(Unknown Source)
    at org.hsqldb.jdbc.JDBCPreparedStatement.executeBatch(Unknown Source)
    at com.indy.engine.actionCodes.jdbc.SimpleJdbcActionCodeTypeI$WrappedPreparedStatement.executeBatch(
    at com.indy.engine.actionCodes.jdbc.SimpleJdbcActionCodeTypeI.finalizeStatement(
    at com.indy.engine.actionCodes.XmlToJdbcActionCodeI.finalizeExecuteCode(
    at com.indy.engine.action.common.ActionCodeTypeI.finalizeExecuteCode(
    at com.indy.engine.manager.ActionCodeExecutor.executeCode(
Caused by: org.hsqldb.HsqlException: statement is not in batch mode
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.error.Error.error(Unknown Source)
    ... 9 more


Most notably, we detected that this may happen when doing a Mapping loading a source XML File into a target HSQL database, but it might also appear in other situations when loading data into HSQL.






When loading data on a target column which has a too small size comparing to data we want to write, the HSQL JDBC driver might throw this unclear error message.

This generic exception might be returned by the HSQL Driver if you are trying to load data in an HSQL target column which size is too small comparing to data that is written.

Make sure that the target columns sizes are correct and are large enough to handle the data you are trying to write into.


Note that in some situations, the HSQL driver might throw a clearer message such as java.sql.SQLDataException: data exception: string data, right truncation) when this happens.

But it depends on the context, sometimes the generic java.sql.SQLException: statement is not in batch mode message is thrown in this situation.