Repository navigation
fix(oracle): read a generated-key object's text before string checks - #3710
Conversation
On BoxLang + Oracle the JDBC generated key comes back as an oracle.sql.ROWID object, and OracleModel.$lastIdLookup called Len()/ListFirst() on it, throwing "Cannot determine length of object of type oracle.sql.ROWID". Fixture population aborted, so the whole BoxLang + Oracle leg ran 0 tests. Add $generatedKeyText(): simple values pass through unchanged; a key object is read via stringValue() (oracle.sql.ROWID) or toString() (the java.sql.RowId contract); anything without a text form is "" and falls back to CURRVAL. The numeric and extended-ROWID gates run on the text exactly as before, so the string paths on Lucee and Adobe are unchanged. Specs feed stringValue(), toString()-only and opaque key objects through $identitySelect (DB-free via OracleProbe), and a real oracle.sql.ROWID where the driver is on the classpath. The first three errored before the fix. Closes #3708 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
|
Review: independent reviewer (rev1.r1), commit
Placement in Injection safety. The text an object produces is still fully gated before it reaches any SQL:
Invariant #14 (Adobe 2025 JPMS), checked explicitly. There's no member call on a JDK-internal type.
Specs. They're DB-free (stubs plus |
|
Independent review of 8b2a9f8: source review clean; Oracle runtime evidence pending. Independently ran CLAUDE.md invariant #14: these calls receive the driver-supplied Oracle key, not an object from a JDK-internal factory. Final clearance awaits the actual Oracle totals from dispatch 36341832355, whose head matches this PR, including BoxLang and the Adobe 2025 leg if it reaches the suite. At review time those results are not available; a soft-fail job colour would not substitute for executed-test totals. |
|
Follow-up from rev1.r1: the merge gate is met. From dispatch 36341832355, reading the result JSON rather than the job colour (via dev1-design):
The 5 BoxLang errors have separate root causes that this leg couldn't reach until now: |
|
Final review of 8b2a9f8: APPROVE for #3708's scope. No blocking findings in this patch. Downloaded and inspected the actual JSON artifacts from dispatch 36341832355 at this exact head:
The five BoxLang errors are the timestamp diagnostic/normalization and four bulk insert transaction cases now tracked in #3714/#3715, outside this patch's generated-key conversion. This approval does not certify the full release matrix green. Adobe 2025 is still pending and has its separate #3709 blocker; it is not being silently counted as a pass. Earlier independent local verification: database suite 167/0/0. Invariant #14 and BoxLang catch-state handling reviewed in the preceding comment. |
Summary
Closes #3708 (4.1.1 release blocker). On BoxLang + Oracle the JDBC generated key comes back as an
oracle.sql.ROWIDobject, andOracleModel.$lastIdLookupcalledLen()/ListFirst()on it:Cannot determine length of object of type oracle.sql.ROWID(OracleModel.cfc:194, via fixturepopulate.cfm:507). Fixture population aborted, so the whole BoxLang + Oracle leg ran 0 tests. The stringassumption dates from #3010.
Fix: a new
$generatedKeyText(value)normalizes the driver key before any string work:stringValue()(oracle.sql.ROWID), elsetoString()(thejava.sql.RowIdcontract);"", which means "no usable key" and falls back to the existing CURRVAL lookup.The numeric and extended-ROWID (
^[A-Za-z0-9/+]{18}$) gates then run on that text unchanged beforeanything reaches SQL.
oracle.sqlis an ordinary exported package in the ojdbc jar, so the member call is not theJDK-internal case from invariant 14.
Tests (RED first)
OracleUnitSpec→ non-simple driver keys (#3708). These run DB-free, through$identitySelectand the existingOracleProbe:stringValue()→ numeric keyCan't cast Component … to StringtoString()viaresult.rowid(the ACF surface)CHARTOROWID('…')lookupCHARTOROWIDoracle.sql.ROWID(only where the driver is on the classpath)Lucee 7 + SQLite local:
wheels.tests.specs.database167/0/0 (before: 164 + 3 errors);wheels.tests.specs.model1050/0/0.
Oracle legs
Oracle is soft-fail in CI, so the leg's colour proves nothing; the totals are the gate. I couldn't run
tools/test-matrix.shlocally: the sharedwheelscompose project is in use by another session, and memory is tight.So the evidence is the
compat-matrixdispatch on this branch, with per-leg totals read from the job logs:https://github.com/wheels-dev/wheels/actions/runs/36341832355. I'll add the boxlang/lucee7/adobe2023 + oracle
totals here when it finishes.
Not changed
Len/ListFirstonresult.generatedKey. Their BoxLang legspass today (their drivers return strings), so they're left alone in this release fix.
$generatedKeyTextcouldmove to
Baselater if another driver starts returning key objects.🤖 Generated with Claude Code