With camel-jpa under split(), the transacted camel route requires N loop + 1 JDBC connections

Solution Verified - Updated -

Issue

Let's say camel-jpa is used under split() and it will be invoked 2 times. (2 times loop)
If the max connection pool for JDBC connection is set as 1 and
is used, a request will fail with "Connection is not available".

<route id="get-cat-route">
  <from id="_from2" uri="direct:get-cat"/>
  <setBody id="_setBody1">
    <constant>1,2</constant>
  </setBody>
  <transacted id="_transacted1"/>
  <split id="_split1">
    <simple>${body}</simple>
    <to id="_to2" uri="jpa:org.mycompany.entity.Cat?namedQuery=get_all_cats"/>
  </split>
</route>

error log

Caused by: java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30002ms.

Environment

  • Red Hat Fuse
    • 7.11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content