Skip to content
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

inTopLevelTransaction with specific database #448

Closed
doxavore opened this issue Dec 17, 2018 · 1 comment
Closed

inTopLevelTransaction with specific database #448

doxavore opened this issue Dec 17, 2018 · 1 comment

Comments

@doxavore
Copy link

When requiring a new transaction (and the caller may already be in a transaction) with a single database seems to work with:

inTopLevelTransaction(
    isolationLevel,
    repetitionAttempts,
    null,
    statement
)

However, it isn't clear how this should work for a transaction when you're using (and possibly interleaving) multiple databases. TransactionManager.managerFor is marked as internal, so this doesn't work:

inTopLevelTransaction(
    isolationLevel,
    repetitionAttempts,
    TransactionManager.managerFor(database),
    statement
)

Is there a better way to handle this? Should we provide an overload of inTopLevelTransaction that accepts a Database instead of a TransactionManager? Or do we need to create a new TransactionManager for each inTopLevelTransaction?

@Tapac
Copy link
Contributor

Tapac commented Dec 23, 2018

Agree. I had replaced TransactionManager with Database as 3rd parameter of inTopLevelTransaction.

@Tapac Tapac closed this as completed Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants