{"record":{"id":"18430876d42ad3d0","repo":"hibernate/hibernate-orm","slug":"unsupported-lock-mode-lockmode","errorCode":null,"errorMessage":"Unsupported lock mode : {lockMode}","messagePattern":"Unsupported lock mode : (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java","lineNumber":2456,"sourceCode":"\t/**\n\t * A {@link LockingStrategy} which is able to acquire a database-level\n\t * lock with the specified {@linkplain LockMode level}.\n\t *\n\t * @param lockable The persister for the entity to be locked.\n\t * @param lockMode The type of lock to be acquired.\n\t * @return The appropriate locking strategy.\n\t *\n\t * @since 7\n\t */\n\tpublic LockingStrategy getLockingStrategy(EntityPersister lockable, LockMode lockMode, PessimisticLockScope lockScope) {\n\t\treturn switch (lockMode) {\n\t\t\tcase PESSIMISTIC_FORCE_INCREMENT -> buildPessimisticForceIncrementStrategy( lockable, lockMode, lockScope );\n\t\t\tcase UPGRADE_NOWAIT, UPGRADE_SKIPLOCKED, PESSIMISTIC_WRITE -> buildPessimisticWriteStrategy( lockable, lockMode, lockScope );\n\t\t\tcase PESSIMISTIC_READ -> buildPessimisticReadStrategy( lockable, lockMode, lockScope );\n\t\t\tcase OPTIMISTIC_FORCE_INCREMENT -> buildOptimisticForceIncrementStrategy( lockable, lockMode );\n\t\t\tcase OPTIMISTIC -> buildOptimisticStrategy( lockable, lockMode );\n\t\t\tcase READ -> buildReadStrategy( lockable, lockMode, lockScope );\n\t\t\tdefault -> throw new IllegalArgumentException( \"Unsupported lock mode : \" + lockMode );\n\t\t};\n\t}\n\n\t/**\n\t * A {@link LockingStrategy} which is able to acquire a database-level\n\t * lock with the specified {@linkplain LockMode level}.\n\t *\n\t * @param lockable The persister for the entity to be locked.\n\t * @param lockMode The type of lock to be acquired.\n\t * @return The appropriate locking strategy.\n\t *\n\t * @since 3.2\n\t *\n\t * @deprecated Use {@linkplain #getLockingStrategy(EntityPersister, LockMode, PessimisticLockScope)} instead.\n\t */\n\t@Deprecated(since = \"7\", forRemoval = true)\n\tpublic LockingStrategy getLockingStrategy(EntityPersister lockable, LockMode lockMode) {\n\t\treturn getLockingStrategy( lockable, lockMode, PessimisticLockScope.NORMAL );","sourceCodeStart":2438,"sourceCodeEnd":2474,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java#L2438-L2474","documentation":"Error \"Unsupported lock mode : {lockMode}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Triggered when the application calls a Hibernate dialect feature that the configured database dialect cannot provide: Unsupported lock mode : the requested lock mode.","commonSituations":"Common when running against a database whose dialect lacks this capability, when a mapping or HQL/Criteria query requests unsupported functionality, or when the wrong dialect is configured for the database in use. Error: Unsupported lock mode : the requested lock mode.","solutions":["Use a LockMode supported by the database (e.g. PESSIMISTIC_READ/WRITE).","Upgrade to a dialect version that supports the requested lock mode."],"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"}