Closed mrkam2 closed 3 years ago
This is why the default behavior is to assume the developer knows what they are doing. If you are using multiple databases, within a single TX, you can't use this feature to trap unintentional nesting. I'll update the documentation to clarify that.
This is why the default behavior is to assume the developer knows what they are doing. If you are using multiple databases, within a single TX, you can't use this feature to trap unintentional nesting. I'll update the documentation to clarify that.
Is old-autocommit = false
not a good indicator of already being inside a transaction?
@mrkam2 Nope. There are other reasons for disabling auto-commit (some DBs require auto-commit is disabled for certain DDL operations, for example). JDBC is pretty nasty in this respect because a "transaction" is really just a convention for calling .commit
or .rollback
-- or using savepoints. The *nested-tx*
option was only added about a year ago and I originally didn't plan to document it, except as a potential aid to migration. The default behavior of trusting the developer has been the same since next.jdbc
was released, over a year prior to that.
Describe the bug Nested transactions detection checks for
*active-tx*
variable that is not specific to the DB or connection.To Reproduce
*nested-tx*
toprohibit
.Expected behavior "Nested" transactions over different DBs should be allowed.