flowable/flowable-engine · error · FlowableException
no insert statement for ${entities.iterator().next().getClas
Error message
no insert statement for ${entities.iterator().next().getClass()} in the ibatis mapping files What it means
Thrown by DbSqlSession.flushBulkInsert when the bulk insert statement mapped for an entity class resolves to null after dbSqlSessionFactory mapping. It means the entity's ibatis mapping file does not define (or does not register) the bulk insert statement required to persist that entity type.
Source
Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/db/DbSqlSession.java:553
protected void flushBulkInsert(Collection<Entity> entities, Class<? extends Entity> clazz) {
String insertStatement = dbSqlSessionFactory.getBulkInsertStatement(clazz);
insertStatement = dbSqlSessionFactory.mapStatement(insertStatement);
if (insertStatement == null) {
throw new FlowableException("no insert statement for " + entities.iterator().next().getClass() + " in the ibatis mapping files");
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Add the bulk insert statement to the entity's ibatis mapping XML file (check the mapping is on the classpath and loaded).
- Register/override the insert statement mapping in DbSqlSessionFactory (setInsertStatement/setBulkInsertStatement) for the entity class.
- Verify the mapped statement name survives mapStatement (database-type specific prefixes) and exists for your DB type.
- If using a custom entity, extend EntityImpl and follow the pattern of a built-in entity, including its XML mapper entry in the SqlSessionFactory configuration.
Example fix
// before (custom entity, no mapping) <insert id="insertMyEntity">...</insert> // after (add the bulk insert variant used by flushBulkInsert) <insert id="bulkInsertMyEntity" parameterType="java.util.Collection">INSERT INTO MY_ENTITY (...) VALUES <foreach ...>(...)</foreach></insert>
Defensive patterns
Strategy: fallback
When it happens
Trigger: Flushing a collection of new entities of a type whose DbSqlSessionFactory has no bulk insert statement registered, e.g. an entity whose mapping XML lacks the insert statement, or a custom entity added without registering insertStatement/bulkInsertStatement names.
Common situations: Adding a custom entity/EntityManager without adding the corresponding MyBatis mapping XML; upgrading Flowable and using a custom DbSqlSessionFactory with stale statement mappings; typos in the statement name returned by the entity's getPersistentState-related insert mapping.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- no update statement for ${updatedObject.getClass()} in the i
- no delete statement for ${entity.getClass()} in the ibatis m
- no delete statement for <persistentObjectClass> in the ibati
- couldn't get table counts
- couldn't get flowable table names using metadata: " + e.getM
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/27e42be705cc2c9e.
Report an issue: GitHub.