Skip to content

Fix: Port transaction details in the DB report mediator [main]#2103

Merged
SanojPunchihewa merged 1 commit intomainfrom
fixing-issue-2099-main-1773912815
Mar 20, 2026
Merged

Fix: Port transaction details in the DB report mediator [main]#2103
SanojPunchihewa merged 1 commit intomainfrom
fixing-issue-2099-main-1773912815

Conversation

@wso2-engineering-bot
Copy link

@wso2-engineering-bot wso2-engineering-bot commented Mar 19, 2026

This PR was automatically generated by Claude AI.

Summary by CodeRabbit

  • Documentation
    • Updated DB Report mediator documentation with improved configuration guidance
    • Added information about transaction support options for mediator configurations
    • Enhanced configuration examples for connection pool and datasource setups
    • Clarified transactional datasource requirements and setup instructions for users

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

Walkthrough

Documentation update for the DB Report mediator introducing a useTransaction attribute and reorganizing configuration sections. Connection Pool and datasource variants now include updated examples, with inline pool connection parameters replaced by datasource references and explicit transactional setup requirements.

Changes

Cohort / File(s) Summary
DB Report Mediator Documentation
en/docs/reference/mediators/db-report-mediator.md
Introduced useTransaction attribute for <dbreport> syntax. Reorganized configuration sections with new "General configurations" and "Connection Pool configurations" subsections. Updated examples to use datasource references instead of inline connection parameters. Added transactional datasource setup requirements (XADataSource with defaultAutoCommit=false) and provided sample MySQL datasource configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A transaction so fine, now clearly aligned! 🐰
DB Reports with datasources, brilliantly designed.
Pools and connections dance in harmony's light,
Documentation refined, configurations bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and lacks required sections from the template such as Purpose, Goals, Approach, User stories, Release note, and other standard documentation sections. Expand the description to include all required template sections: Purpose (with issue link context), Goals, Approach, User stories, Release note, Documentation links, and other applicable sections.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: porting transaction details to DB report mediator documentation on the main branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fixing-issue-2099-main-1773912815
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
en/docs/reference/mediators/db-report-mediator.md (1)

81-98: ⚠️ Potential issue | 🟠 Major

Conflicting/duplicated connection-pool guidance in the same page.

Line 88-97 still shows a <dblookup> sample under DB Report docs, while Line 140-150 adds the correct <dbreport> sample. With the new “General configurations” + “Connection Pool configurations” split, this now reads as contradictory and duplicative.

✏️ Suggested cleanup
-!!! Info
-    When specifying the DB connection using a connection pool, other than specifying parameter values inline, you can also specify following parameter values of the connection information (i.e. Driver, URL, User and password) as registry entries. The advantage of specifying a parameter value as a registry entry is that the same connection information configurations can be used in different environments simply by changing the registry entry value. To do this, give the registry path within the `key` attribute as shown in the example below.
-    ```xml
-    <dblookup xmlns="http://ws.apache.org/ns/synapse">
-    <connection>
-        <pool>
-            <password key="conf:/repository/esb/password"/>
-            <driver key="conf:/repository/esb/driver"/>
-            <url key="conf:/repository/esb/url"/>
-            <user key="conf:/repository/esb/username"/>
-        </pool>
-    </connection>
-    </dblookup>
-    ```
+<!-- Keep this info only once under "Connection Pool configurations" -->

Also applies to: 133-150

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/docs/reference/mediators/db-report-mediator.md` around lines 81 - 98, The
page contains a duplicated/conflicting connection-pool example: the <dblookup>
example inside the "General configurations" section should be removed or
replaced so only the correct <dbreport> example appears under the connection
pool guidance; update/remove the <dblookup> snippet (referenced in the block
showing <dblookup xmlns="http://ws.apache.org/ns/synapse">) and ensure the
authoritative pool example remains as the <dbreport> sample in the "Connection
Pool configurations" section so the page has a single, consistent example for DB
Report.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@en/docs/reference/mediators/db-report-mediator.md`:
- Around line 42-44: Update the "External Datasource" section to explicitly
state that the useTransaction setting on external datasources does NOT
participate in Transaction Mediator-managed commit/rollback; reference the term
useTransaction and the Transaction Mediator so readers know the distinction, and
add a clarifying sentence near the existing Carbon Datasource note (and mirrored
locations around lines showing useTransaction) that only Carbon Datasource
integrates with the Transaction Mediator for orchestrated commit/rollback
operations.
- Around line 314-333: The XML samples use literal angle-bracketed text
"<DB_NAME>" inside the <dataSourceProps><property name="url"> element which
produces invalid XML; update the URL placeholder in the <datasource> example
(the <dataSourceProps> property with name="url" under the <datasource> named
"inventoryDB") to a valid placeholder such as DB_NAME (no angle brackets) or a
shell-style token like ${DB_NAME}, or escape the brackets (e.g.,
&lt;DB_NAME&gt;), and make the same replacement for the other identical sample
further down so the XML remains well-formed.

---

Outside diff comments:
In `@en/docs/reference/mediators/db-report-mediator.md`:
- Around line 81-98: The page contains a duplicated/conflicting connection-pool
example: the <dblookup> example inside the "General configurations" section
should be removed or replaced so only the correct <dbreport> example appears
under the connection pool guidance; update/remove the <dblookup> snippet
(referenced in the block showing <dblookup
xmlns="http://ws.apache.org/ns/synapse">) and ensure the authoritative pool
example remains as the <dbreport> sample in the "Connection Pool configurations"
section so the page has a single, consistent example for DB Report.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8305aa02-827c-4bbd-a1d1-b4717c6d53b5

📥 Commits

Reviewing files that changed from the base of the PR and between 8b4b668 and 3ca9fee.

📒 Files selected for processing (1)
  • en/docs/reference/mediators/db-report-mediator.md

Comment on lines +42 to +44
!!! Note
You need to use a **Carbon Datasource** with the DBReport mediator for the <a href="{{base_path}}/reference/mediators/transaction-mediator">Transaction Mediator</a> to work correctly. Otherwise, operations like commit, rollback will not function as expected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Transaction support scope is still ambiguous between External vs Carbon datasource.

Line 47/66 shows useTransaction for both datasource variants, but Line 43 and Line 310 state Carbon Datasource is required for Transaction Mediator correctness. Please explicitly state in the External Datasource section that useTransaction there does not participate in Transaction Mediator-managed commit/rollback.

Also applies to: 45-77, 265-268, 310-311

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/docs/reference/mediators/db-report-mediator.md` around lines 42 - 44,
Update the "External Datasource" section to explicitly state that the
useTransaction setting on external datasources does NOT participate in
Transaction Mediator-managed commit/rollback; reference the term useTransaction
and the Transaction Mediator so readers know the distinction, and add a
clarifying sentence near the existing Carbon Datasource note (and mirrored
locations around lines showing useTransaction) that only Carbon Datasource
integrates with the Transaction Mediator for orchestrated commit/rollback
operations.

Comment on lines +314 to +333
```xml
<datasource>
<name>inventoryDB</name>
<jndiConfig useDataSourceFactory="false">
<name>jdbc/inventoryDB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<testOnBorrow>true</testOnBorrow>
<defaultAutoCommit>false</defaultAutoCommit>
<dataSourceClassName>com.mysql.cj.jdbc.MysqlXADataSource</dataSourceClassName>
<username>USERNAME</username>
<password>PASSWORD</password>
<dataSourceProps>
<property name="url">jdbc:mysql://localhost:3306/<DB_NAME></property>
</dataSourceProps>
</configuration>
</definition>
</datasource>
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Invalid placeholder syntax in XML samples (<DB_NAME>).

Line 328 and Line 521 use <DB_NAME> inside element text. Users copying this as-is can end up with invalid XML/parsing issues. Use plain placeholder text or escape brackets.

✅ Suggested fix
-<property name="url">jdbc:mysql://localhost:3306/<DB_NAME></property>
+<property name="url">jdbc:mysql://localhost:3306/DB_NAME</property>

or

-<property name="url">jdbc:mysql://localhost:3306/<DB_NAME></property>
+<property name="url">jdbc:mysql://localhost:3306/&lt;DB_NAME&gt;</property>

Also applies to: 506-526

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@en/docs/reference/mediators/db-report-mediator.md` around lines 314 - 333,
The XML samples use literal angle-bracketed text "<DB_NAME>" inside the
<dataSourceProps><property name="url"> element which produces invalid XML;
update the URL placeholder in the <datasource> example (the <dataSourceProps>
property with name="url" under the <datasource> named "inventoryDB") to a valid
placeholder such as DB_NAME (no angle brackets) or a shell-style token like
${DB_NAME}, or escape the brackets (e.g., &lt;DB_NAME&gt;), and make the same
replacement for the other identical sample further down so the XML remains
well-formed.

@SanojPunchihewa SanojPunchihewa merged commit 66576da into main Mar 20, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants