Fix: Port transaction details in the DB report mediator [main]#2103
Fix: Port transaction details in the DB report mediator [main]#2103SanojPunchihewa merged 1 commit intomainfrom
Conversation
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
WalkthroughDocumentation update for the DB Report mediator introducing a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
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 | 🟠 MajorConflicting/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.,
<DB_NAME>), 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
📒 Files selected for processing (1)
en/docs/reference/mediators/db-report-mediator.md
| !!! 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. | ||
|
|
There was a problem hiding this comment.
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.
| ```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> | ||
| ``` |
There was a problem hiding this comment.
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/<DB_NAME></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., <DB_NAME>), and make the same
replacement for the other identical sample further down so the XML remains
well-formed.
This PR was automatically generated by Claude AI.
Summary by CodeRabbit