问题
I am using quartz in combination with the database. When providing a wrong database password, the db user is then locked and I need then to unlock the user in the database. it seems that my program that uses quartz tries to login a few times in the background till the maximum attempts allowed by the database is reached which causes the locking. Does anyone knows how to avoid this? If the password is wrong, the program should then just report this and not try several times.
My configuration:
org.quartz.scheduler.skipUpdateCheck: true
org.quartz.scheduler.instanceName = feed-scheduler
org.quartz.threadPool.threadCount = 1
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
org.quartz.threadPool.threadPriority = 5
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.tablePrefix = qrtz_
org.quartz.jobStore.isClustered = false
org.quartz.jobStore.dataSource = myDS
org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
org.quartz.dataSource.myDS.URL = urlToDb
org.quartz.dataSource.myDS.user = user
org.quartz.dataSource.myDS.password = pwd
org.quartz.dataSource.myDS.maxConnections = 1
org.quartz.dataSource.myDS.validationQuery=select 0 fro
m dual
回答1:
Quartz implements no AI features to react to database errors/exceptions and you can't ask him to do a specific policy.
When Quartz lose database connection (or when he fails to connect), he will try to reconnect to restore its service.
If you don't want that Quartz locks the user, consider grant a specific privilege to the Quartz user (like ALTER PROFILE <your_profile> LIMIT failed_login_attempts unlimited
)
来源:https://stackoverflow.com/questions/25667774/quartz-scheduler-locks-the-database-user