spring-projects / spring-projects/spring-data-couchbase

Possible bug when using transactions and TransactionalEventListener

Open
#1,776 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: feedback-provided
Dominant language
Java
Stars
284
Forks
197
PR merge metrics
No merged PRs in 30d

Description

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:

2023-07-05T10:48:35.333+01:00 DEBUG 6435 --- [       cb-txn-6] actionalApplicationListenerMethodAdapter : No transaction is active - skipping org.springframework.context.PayloadApplicationEvent[source=org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@65e61854, started on Wed Jul 05 10:48:32 WEST 2023]

Also if I check my bucket I got some extra documents with binary values:
image

In the file couchbaseTransactions.zip is possible to check my current approach to get this working.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached couchbaseTransactions.zip reproduction and compare its behavior on Spring Data Couchbase 3.1.1 and 2.7.13. Trace the logged “No transaction is active” message during commit and verify whether the TransactionalEventListener is invoked. Done means the cause is identified and the listener behavior and extra binary documents are explained or corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.