-
Notifications
You must be signed in to change notification settings - Fork 697
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
"No transaction in context" with multiple Spring contexts in one JVM #407
Comments
For anybody interested in a temporary "hacky" fix, I'm posting my current solution here:
|
@ilya40umov , |
Thx. The example provided has fixed it for me.
I experienced the issue by executing junit5 tests |
…ot-devtools #407 "No transaction in context" with multiple Spring contexts in one JVM
@bastman, @ilya40umov , could you please test your apps with snapshot dependency?
|
@Tapac , I was not able to get the snapshot dependencies into my current project. I tried ... repositories { dependencies { gradlew assemble (output) .... HOME:
FAILURE: Build failed with an exception.
Execution failed for task ':rest-api:compileKotlin'.
Any idea - how to fix it? |
Looks like a jitpack can't build |
@Tapac, thanks for the suggestion! I've just tried replacing |
Exposed version:
0.10.5
There seems to be a bug in the implementation of
SpringTransactionManager
, which leads to "No transaction in context" in runtime.Our set up looks approximately like this:
SpringTransactionManager
, which in turn gets registered throughTransactionManager.registerManager
and then assigned to the current thread.SpringTransactionManager.doCleanupAfterCompletion
is never called (which would executeTransactionManager.resetCurrent(null)
)SpringTransactionManager
, which also gets registered viaTransactionManager.registerManager
, but the current thread already has an instance saved incurrentThreadManager
variableSpringTransactionManager.doCleanupAfterCompletion
is executed and it resets the state of thread local.My current 'hacky' solution involved adding
TransactionManager.resetCurrent(null)
toinitTransaction
method inSpringTransactionManager
, but for that I had to copy the entireSpringTransactionManager
to our codebase as it's final.The text was updated successfully, but these errors were encountered: