fix: prevent ora-21799 in ut_run()#1318
Conversation
|
Hi @martin-bach-oracle |
|
We also faced the same issue recently and a fix is already merged into develop branch. The fix that we have applied can be found here: I will prepare new intermediate release of utPLSQL framework, java-api and utPLSQL-cli, to give them a small refresh. |
|
Thanks for following up. I'm not 100% sure now but I believe your fixes might still have thrown the error reported in the forum. Do you see any downside in changing line 93 in |
|
I will investigate and let you know. |
|
@martin-bach-oracle In general, optional NULL argument is correct functionality but the behavior of this peice of code was unstable. Because it "sometimes fails" and "sometimes works" I consider it to be an oracle bug. The workaround done by @lwasylow maintains the behavior (we still have NULL argument) so I would consider this a better option for now. If that doesn't work, then the case statement needs to be changed to prevent After the fix, every run of our pipeline on 23.26 AI was successful so I am expecting the workaround to be stable. @lwasylow - do you have any insights into research you did and how you figured out that it's related to the fact that using the input argument variable as the problem? |
|
no worries, feel free to close the PR in that case |
|
Thank you @martin-bach-oracle also for your feedback on oracle forum. New releases should be available soon. |
This PR addresses the ORA-21799 duration not active error reported in https://forums.oracle.com/ords/apexds/post/ora-21779-duration-not-active-when-running-utplsql-on-23-26-4428
Initially I thought the error might be thrown during the transition to an autonomous transaction. The most suspicious spot in my investigation was crossing the autonomous boundary with object types in UT.RUN -> RUN_AUTONOMOUS (pragma autonomous_transaction) with a_reporter in out nocopy ut_reporter_base.
Turns out, that wasn't it. The RC appears earlier in the stack:
For gc_initialize, a_event_item is passed as NULL (no event object). My suspicion is that the ORA-21779 occurs on object-duration/type-cast handling at event dispatch time.
I tried passing a real object in UT_RUNNER line 93:
If the treat(NULL as ut_run) is the problem, that should fix the issue. It works on my machine. Kindly review and merge if applicable.