-
Notifications
You must be signed in to change notification settings - Fork 709
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
refactor: EXPOSED-730 Extract TransactionManager companion methods from core module #2405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It looks like use sites generally looks cleaner now
@@ -230,7 +230,7 @@ abstract class AbstractQuery<T : AbstractQuery<T>>( | |||
} | |||
if (set.source != Table.Dual || currentDialect.supportsDualTableConcept) { | |||
append(" FROM ") | |||
set.source.describe(TransactionManager.current(), this) | |||
set.source.describe(CoreManager.currentTransaction(), this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be more specific and and use CoreTransactionManager
name
import java.util.concurrent.ConcurrentLinkedDeque | ||
import java.util.concurrent.atomic.AtomicReference | ||
|
||
private object NotInitializedManager : TransactionManagerApi { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same applied to the naming in other places
1215a7e
to
74f4e06
Compare
e5e5afe
to
cdd9dab
Compare
…om core module As part of the R2DBC implementation: - Remove companion object from original interface and rename to TransactionManagerApi - Create new object CoreManager that stores members responsible for internal processing of databases and their associated managers - Mark this as @internalapi - Rename both module managers to TransactionManager & add their own companion objects that rely on CoreManager - Remove useless casts from everywhere - Move transaction properties out of core so that there is no need to define a core TM
…om core module - Remove strange import optimization results - Return original ThreadLocalTransactionManager into jdbc module with deprecation flag - Refactor Database.connect() variants to account for existing deprecated class
…om core module - Rename new object to CoreTransactionManager - Rename private object to NotInitializedTransactionManager
74f4e06
to
24978aa
Compare
This PR is meant only for merge into R2DBC branch
r2dbc-poc-2
❗Note about the diff size ❗
Description
Summary of the change:
exposed-jdbc
andexposed-r2dbc
now have their ownTransactionManager
with companion object methods, which rely on stored data in common fields found in newexposed-core/CoreManager
object.Detailed description:
Current setup has common
TransactionManager
interface in core module, which uses itscompanion object
to store and process internal data about registered databases and their associated managers. This means that the JDBC and R2DBC implementations would need to always cast when calls likeTransactionManager.current()
are made.TransactionManager
interface and rename the latter toTransactionManagerApi
.CoreManager
to keep all original content from above.currentTransaction()
,currentTransactionOrNull
.TransactionManager...
inexposed-core
withCoreManager...
.@InternalApi
build.gradle.kts
to avoid annotating every use ofCoreManager
in core moduleTransactionManager
so API hasn't changed much & add their own companion objects that rely onCoreManager
dataThreadLocalTransactionManager
toexposed-jdbc
with Deprecation annotation.manager
parameter inDatabase.connect()
variants to account for existing deprecated class.Type of Change
Please mark the relevant options with an "X":
Affected databases:
Checklist
Related Issues
EXPOSED-730