Skip to content

[OPENJPA-3028] Stored procedures on Oracle: REF CURSOR and numeric OUT types - #279

Merged
solomax merged 3 commits into
masterfrom
OPENJPA-3028-oracle-procedures
Nov 7, 2026
Merged

solomax merged 3 commits into
masterfrom
OPENJPA-3028-oracle-procedures

Conversation

@rzo1

@rzo1 rzo1 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Registers Oracle SYS_REFCURSOR parameters as REF_CURSOR (failed with ORA-17004). Numeric OUT values are returned in their registered type, converting only when exact, so nothing is truncated.

Oracle TCK: +19 passing tests, no regressions.

rzo1 added 2 commits November 6, 2026 09:26
… Oracle

Oracle reports a SYS_REFCURSOR parameter of a stored procedure with the
generic type OTHER and the type name REF CURSOR, and its driver rejects
registerOutParameter(OTHER) with ORA-17004, so no procedure returning a
result set through a REF CURSOR could be called. OracleDictionary now
registers such parameters as Types.REF_CURSOR; the existing handling of
cursor OUT parameters then reads the result set.
getOutputParameterValue() returned the value as the driver reported it
and ignored the Java type the parameter was registered with. On Oracle
an INTEGER parameter is a NUMBER, so an OUT parameter registered as
Integer came back as a BigDecimal.

A numeric value is now converted to the registered numeric type. The
conversion to an integral type (Byte, Short, Integer, Long, BigInteger)
is exact: a value with a fraction or outside the range of the registered
type is returned unchanged, as before, instead of being truncated. A
conversion to Float or Double follows the usual floating point rounding.
Non-numeric values are returned unchanged. This applies to all
databases.
@rzo1
rzo1 requested review from cristof and solomax November 6, 2026 14:16
@solomax
solomax merged commit 7359c8d into master Nov 7, 2026
4 checks passed
@solomax
solomax deleted the OPENJPA-3028-oracle-procedures branch November 7, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants