Claus Ibsen created CAMEL-27794:
-----------------------------------
Summary: camel-jt400: ccsid breaks reused pooled connections,
service program parameters are passed by value
Key: CAMEL-27794
URL: https://issues.apache.org/jira/browse/CAMEL-27794
Project: Camel
Issue Type: Bug
Components: camel-jt400
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-jt400 for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31137).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. ccsid breaks reused pooled connections
{{Jt400Configuration.getConnection()}} calls {{system.setCcsid(ccsid)}} every
time it takes an AS400 from the pool. JTOpen's {{AS400.setCcsid}} throws
ExtendedIllegalStateException once the object is connected, and the pool hands
back the same connected object. So with ccsid set, the producers fail from
about the second message on, and the connection is not returned to the pool.
Proposed change: call setCcsid only when {{!system.isConnected()}}.
h4. 2. Service program input-only and output-only parameters are passed by value
{{Jt400PgmProducer.getParameterList}} uses {{new ProgramParameter(data)}} /
{{new ProgramParameter(len)}}, which default to PASS_BY_VALUE; only
input+output parameters are passed by reference. ServiceProgramCall allows at
most 4 bytes by value, so text or byte[] parameters longer than that cannot
work for a .SRVPGM.
Proposed change: PASS_BY_REFERENCE for these parameters.
h4. 3. Minor
{{Jt400Component.doShutdown}} closes the connection pool even when the user
supplied it. A URI without a password fails with an
ArrayIndexOutOfBoundsException at {{credentials[1]}} instead of a clear error.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)