gpt4 book ai didi

java - Quartz Scheduler 锁定数据库用户

转载 作者:行者123 更新时间:2023-12-02 05:29:51 26 4
gpt4 key购买 nike

我将quartz与数据库结合使用。当提供错误的数据库密码时,db 用户将被锁定,然后我需要解锁数据库中的用户。看来我使用quartz的程序尝试在后台登录几次,直到达到数据库允许的最大尝试次数,这会导致锁定。有谁知道如何避免这种情况?如果密码错误,程序应该只是报告此情况,而不是多次尝试。

我的配置:

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

米双

最佳答案

Quartz 没有实现任何人工智能功能来对数据库错误/异常使用react,你不能要求他执行特定的策略。

当Quartz失去数据库连接(或者连接失败)时,他会尝试重新连接以恢复其服务。

如果您不希望 Quartz 锁定用户,请考虑向 Quartz 用户授予特定权限(例如 ALTER PROFILE <your_profile> LIMIT failed_login_attempts unlimited )

关于java - Quartz Scheduler 锁定数据库用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25667774/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com