You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Lock Provider: shedlock-provider-jdbc-template (oracle)
ShedLock configuration: -
ShedLock logs:
2023-04-11T09:28:22.241+02:00 ReferenceDataApplication ERROR 12824 --- [ scheduling-1] n.j.s.p.j.JdbcTemplateStorageAccessor : Unexpected exception org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [INSERT INTO shedlock(name, lock_until, locked_at, locked_by) VALUES(?, SYS_EXTRACT_UTC(SYSTIMESTAMP) + ?, SYS_EXTRACT_UTC(SYSTIMESTAMP), ?)]; ORA-00001: unique constraint (NDANIELS.SYS_C009862) violated at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:87) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1539) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:981) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:328) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:333) at net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.lambda$execute$0(JdbcTemplateStorageAccessor.java:119) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.execute(JdbcTemplateStorageAccessor.java:119) at net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.insertRecord(JdbcTemplateStorageAccessor.java:68) at net.javacrumbs.shedlock.support.StorageBasedLockProvider.doLock(StorageBasedLockProvider.java:79) at net.javacrumbs.shedlock.support.StorageBasedLockProvider.lock(StorageBasedLockProvider.java:62)
Expected behavior
No error log at startup is lock already exists in DB
Actual behavior
After migration to Spring 6, Shedlock started printing this error on each startup. This is because Spring 6 changed the default exception translator (SQLExceptionSubclassTranslator in the stack above instead of SQLErrorCodeSQLExceptionTranslator).
From the Spring migration doc: "Spring's default JDBC exception translator is the JDBC 4 based SQLExceptionSubclassTranslator now. SQLErrorCodeSQLExceptionTranslator kicks in for user-provided sql-error-codes.xml files still. It can pick up Spring's legacy default error code mappings as well when triggered by a (potentially empty) user-provided file in the root of the classpath, or by explicit SQLErrorCodeSQLExceptionTranslator setup."
We could add an empty 'error code mapping' but I guess it would be better that Shedlock doesn't print such error by default. (put the log to debug as for DuplicateKeyException ?)
The text was updated successfully, but these errors were encountered:
2023-04-11T09:28:22.241+02:00 ReferenceDataApplication ERROR 12824 --- [ scheduling-1] n.j.s.p.j.JdbcTemplateStorageAccessor : Unexpected exception org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [INSERT INTO shedlock(name, lock_until, locked_at, locked_by) VALUES(?, SYS_EXTRACT_UTC(SYSTIMESTAMP) + ?, SYS_EXTRACT_UTC(SYSTIMESTAMP), ?)]; ORA-00001: unique constraint (NDANIELS.SYS_C009862) violated at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:87) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1539) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:981) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:328) at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:333) at net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.lambda$execute$0(JdbcTemplateStorageAccessor.java:119) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.execute(JdbcTemplateStorageAccessor.java:119) at net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateStorageAccessor.insertRecord(JdbcTemplateStorageAccessor.java:68) at net.javacrumbs.shedlock.support.StorageBasedLockProvider.doLock(StorageBasedLockProvider.java:79) at net.javacrumbs.shedlock.support.StorageBasedLockProvider.lock(StorageBasedLockProvider.java:62)
Expected behavior
No error log at startup is lock already exists in DB
Actual behavior
After migration to Spring 6, Shedlock started printing this error on each startup. This is because Spring 6 changed the default exception translator (SQLExceptionSubclassTranslator in the stack above instead of SQLErrorCodeSQLExceptionTranslator).
From the Spring migration doc:
"Spring's default JDBC exception translator is the JDBC 4 based SQLExceptionSubclassTranslator now. SQLErrorCodeSQLExceptionTranslator kicks in for user-provided sql-error-codes.xml files still. It can pick up Spring's legacy default error code mappings as well when triggered by a (potentially empty) user-provided file in the root of the classpath, or by explicit SQLErrorCodeSQLExceptionTranslator setup."
We could add an empty 'error code mapping' but I guess it would be better that Shedlock doesn't print such error by default. (put the log to debug as for DuplicateKeyException ?)
The text was updated successfully, but these errors were encountered: