-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSSQL and snaphost isolation issues #273
Comments
I am not very familiar with Snapshot isolation, but from what I can tell it does not look to be compatible with the default locking mechanism of db-scheduler, optimistic locking. There is another locking mechanism (select for update) but it is currently only implemented for postgres. It is high up on the roadmap to support this for all databases supporting Are you using transactions that span |
Thank You for Your response! I saw that You've already created an issue for the Answering Your last question: unfortunately i have to schedule and cancel tasks during operations which involves another db operations and are executed in Transactions - but fortunately it is not a critical issue becuase i am fine with implementing error handling in those tasks which could be scheduled as a part of eventually rolled-back transaction. So i will probably go with that approach (creating second Datasource). The last thing is - autoconfiguration which normally creates |
Yeah, I have started working on it, but put on hold to work on serialization.
Is there something that could be done to the autoconfiguration that would make it easier for you? |
I didn't notice Your comment. Sorry. |
…unner transaction support. (#371) * Adding support for `lock-and-fetch` aka. `SELECT FOR UPDATE .. SKIP LOCKED` for MSSQL/SqlServer. Though testing has shown that lock-and-fetch are prone to deadlocks, so it is not recommended until that is understood/resolved. However, a query-hint was also added to `fetch-and-lock-on-execute` for MSSQL, and it appears this resolves issues with deadlocks for that strategy. * Updates jdbc-handling dependency `micro-jdbc` * Re-written transaction-handling (in `micro-jdbc`) * Shading `micro-jdbc` dependency * Explicit limit also for SqlServer, MySQL, Oracle * Adds ClusterTest for Sql Server (test concurrency) ## Fixes * #264 * #337 * #348 ? * #273 ? ## Further work / fix later * Mysql v8 skip locked syntax * MariaDB skip locked syntax * Oracle skip locked syntax ## Reminders - [x] Added/ran automated tests - [x] Update README and/or examples --- cc @kagkarlsson
🎉 This issue has been resolved in |
HI,
I am using db-scheduler 10.5 version with Spring Boot 2.5.6.
Database which i use is Microsoft SQL Server 2019.
I use db scheduler autoconfiguration so basically the whole configuration of db-scheduler is just:
What's really important: for some other reasons we HAD to switch to Snaphost isolation in MSSQL. Unfortunately Spring Boot doesn't support that isolation so it had to be set on hikari connection level:
The problem is: from time to time i can see the following errors in the logs:
So the easiest way to solve it would be to NOT use Snapshot isolation for db-scheduler tasks.
It could be done by creating another DataSource just for db-scheduler. Like that:
But: the problem is that with that approach i will lose transactionality for db-scheduler (because i will have two separate DataSource's).
Maybe anybody had similar problem and is able to tell me how could i solve that issue?
The text was updated successfully, but these errors were encountered: