jiriOndrusek-agent commented on PR #28496:
URL: https://github.com/apache/camel/pull/28496#issuecomment-6413406476
Thanks for the review!
1. **More than one `TransactionStrategy`** – Added in `8070767b0864`.
`findSingleByType` still picks the bean (`JpaHelper.java:103`). When it returns
null, `JpaHelper.java:107-112` counts the beans and logs a WARN if there is
more than one, then the default is created. New test:
`JpaComponentTest.testJpaComponentMoreTransactionStrategiesInRegistry`. Docs
and upgrade guide updated.
Small correction: the old code never warned here, because it never looked
up a `TransactionStrategy` at all, so extra beans were ignored silently. The
WARN at `JpaComponent.java:175` is about a missing `EntityManagerFactory`. The
doc sentence is left over from the old `TransactionManager` lookup (removed in
CAMEL-19225); CAMEL-19782 only renamed it in the docs.
2. **`TransactionTemplate`** – Preserved. The PR does not touch
`DefaultTransactionStrategy`. Without a single `TransactionStrategy` bean, it
is still created with the same arguments as before (`JpaHelper.java:114`,
`:135`). Its `initTransactionManager` uses a single
`PlatformTransactionManager` (`DefaultTransactionStrategy.java:67-78`), else
the transaction manager of a single `TransactionTemplate` (`:84-96`), else a
new `JpaTransactionManager` (`:38-39`). As before, only the template's
transaction manager is reused. A new `TransactionTemplate` with
`PROPAGATION_REQUIRED` is created (`:41`, `:105-110`). So users with a
registered template see a change only if they also register exactly one
`TransactionStrategy`.
3. **Return type of `createTransactionStrategy()`** – Nothing in the Camel
repo overrides it: `git grep` only finds `JpaEndpoint.java:285` and `:625`. The
camel-quarkus JPA extension rewrites it by method name only, so it is not
affected. A user override that returns `DefaultTransactionStrategy` still
compiles (covariant return), but it has to be recompiled: a class built against
the old signature is silently not called. I can add that to the upgrade guide
if you like.
_Generated with [Claude Code](https://claude.com/claude-code) on behalf of
@JiriOndrusek_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]