[ 
https://issues.apache.org/jira/browse/CAMEL-27794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-27794:
--------------------------------
    Description: 
Found while improving the option descriptions of camel-jt400 for CAMEL-23832 
(commit 
https://github.com/apache/camel/commit/8a5ecaf41ffca0f81f3d680155485d5214951a59,
 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_

  was:
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_


> 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
>            Priority: Minor
>             Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-jt400 for CAMEL-23832 
> (commit 
> https://github.com/apache/camel/commit/8a5ecaf41ffca0f81f3d680155485d5214951a59,
>  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)

Reply via email to