[
https://issues.apache.org/jira/browse/CAMEL-27698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-27698:
--------------------------------
Fix Version/s: 4.25.0
(was: 4.24.0)
> camel-hibernate: stop drops the configured SessionFactory, maximumResults
> lacks defaultValue
> --------------------------------------------------------------------------------------------
>
> Key: CAMEL-27698
> URL: https://issues.apache.org/jira/browse/CAMEL-27698
> Project: Camel
> Issue Type: Bug
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-hibernate for
> CAMEL-23832 (PR (commit
> https://github.com/apache/camel/commit/71fd27023ee186edb10c471f7120a6dfd236ed59)).
> These are separate problems of the component; the descriptions commit only
> documents the current behavior.
> h4. 1. Component stop drops an explicitly configured SessionFactory,
> endpoints keep a stale one
> {{HibernateComponent.doStop()}} sets {{sessionFactory}} to null in every
> case, also when it was set with {{setSessionFactory()}} (not owned, not
> closed).
> When the component (or the CamelContext) is stopped and started again,
> {{HibernateComponent.doStart()}} no longer sees the configured
> SessionFactory: it looks up a single SessionFactory in the registry, and if
> there is none it bootstraps a new one (usually without entity classes, so
> startup fails or the entities are unknown).
> {{HibernateEndpoint}} has no {{doStop()}}, and
> {{HibernateEndpoint.doStart()}} only takes the component's SessionFactory
> when its own field is null. So an endpoint that survives the restart keeps
> the SessionFactory from before the stop, which is closed if the component had
> created it.
> Proposed change: only clear {{sessionFactory}} in {{doStop()}} when the
> component owns it, and let the endpoint take the SessionFactory from the
> component on each start (or clear it in an endpoint {{doStop()}}).
> h4. 2. maximumResults has no defaultValue in the metadata
> {{HibernateEndpoint.maximumResults}} is an {{int}} whose default 0 means no
> limit (see {{HibernateConsumer.poll()}}), but the {{@UriParam}} has no
> {{defaultValue}}, so the catalog and the docs show no default.
> Proposed change: add {{defaultValue = "0"}}.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)