-
Notifications
You must be signed in to change notification settings - Fork 190
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
Possible bug when using transactions and TransactionalEventListener #1776
Comments
The couchbase transaction does get processed and TransactionalApplicationListenerMethodAdapter.onApplicationEvent() does get triggered with the event having the DataCreated object as the payload. But it falls through to the 'else'.
|
Hi @mikereiche, we saw this same behaviour in our side. I think that the problem is that spring doesn't know that there is an active transaction. With this, spring should be aware that a transaction is running because the event is sent inside a method that is annotated with |
Yes. org.springframework.data.couchbase.core.TransactionSupport.checkForTransactionInThreadLocalStorage() [ the method name is a bit of a misnomer]. Couchbase transactions probably needs to be calling TransactoinSynchronizationManager.bindResource() / unbindResource(). |
This worked with spring boot 2.7.13 and with spring dependency management 1.0.15.RELEASE. I don't know what was the spring-data-couchbase version. |
Hi,
I'm trying to use transactions and TransactionalEventListener, but it seams that spring have some incompatibly issue with this in the version 3.1.1 (I had this working on the version 2.7.13).
When the transaction is committed the TransactionalEventListener isn't been triggered and on the logs I got this entry:
Also if I check my bucket I got some extra documents with binary values:
In the file couchbaseTransactions.zip is possible to check my current approach to get this working.
The text was updated successfully, but these errors were encountered: