{"record":{"id":"f611fe47ae2fbf54","repo":"hibernate/hibernate-orm","slug":"persistent-id-tables-cannot-use-afteruseaction-dro","errorCode":null,"errorMessage":"Persistent ID tables cannot use AfterUseAction.DROP : ${temporaryTable.getTableExpression()}","messagePattern":"Persistent ID tables cannot use AfterUseAction\\.DROP : (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/PersistentTableStrategy.java","lineNumber":60,"sourceCode":"\tpublic static final String SCHEMA = \"hibernate.query.mutation_strategy.persistent.schema\";\n\n\tpublic static final String CATALOG = \"hibernate.query.mutation_strategy.persistent.catalog\";\n\n\tprivate final TemporaryTable temporaryTable;\n\tprivate final SessionFactoryImplementor sessionFactory;\n\n\tprivate boolean prepared;\n\n\tprivate boolean dropIdTables;\n\n\tpublic PersistentTableStrategy(\n\t\t\tTemporaryTable temporaryTable,\n\t\t\tSessionFactoryImplementor sessionFactory) {\n\t\tthis.temporaryTable = temporaryTable;\n\t\tthis.sessionFactory = sessionFactory;\n\n\t\tif ( sessionFactory.getJdbcServices().getDialect().getPersistentTemporaryTableStrategy().getTemporaryTableAfterUseAction() == AfterUseAction.DROP ) {\n\t\t\tthrow new IllegalArgumentException( \"Persistent ID tables cannot use AfterUseAction.DROP : \" + temporaryTable.getTableExpression() );\n\t\t}\n\t}\n\n\tpublic TemporaryTableStrategy getTemporaryTableStrategy() {\n\t\treturn castNonNull( sessionFactory.getJdbcServices().getDialect().getPersistentTemporaryTableStrategy() );\n\t}\n\n\tpublic void prepare(\n\t\t\tMappingModelCreationProcess mappingModelCreationProcess,\n\t\t\tJdbcConnectionAccess connectionAccess) {\n\t\tif ( prepared ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprepared = true;\n\n\t\tfinal ConfigurationService configService =\n\t\t\t\tmappingModelCreationProcess.getCreationContext()","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/query/sqm/mutation/internal/temptable/PersistentTableStrategy.java#L42-L78","documentation":"Error \"Persistent ID tables cannot use AfterUseAction.DROP : ${temporaryTable.getTableExpression()}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An API operation is invoked on a query object that does not support it.","commonSituations":"Calling query hint, locking, pagination, conversion, or mutation APIs on a query kind (native vs HQL, select vs mutation) that does not implement them.","solutions":["Persistent ID tables are shared and cannot be dropped after use; AfterUseAction.DROP is invalid.","Use AfterUseAction.CLEAN for persistent temporary tables."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}