GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: prevent ora-21799 in ut_run() by martin-bach-oracle · Pull Request #1318 · utPLSQL/utPLSQL

Conversation

@martin-bach-oracle

@martin-bach-oracle martin-bach-oracle commented Apr 21, 2026

Copy link
Copy Markdown

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:

  • The stack trace shows a failure at startup event: UT_RUNNER line 93 triggers gc_initialize (ut_runner.pkb (line 93))
  • Event manager dispatches listener (ut_event_manager.pkb (line 70))
  • Reporter handler does treat(a_event_item as ut_run) on initialize (ut_reporter_base.tpb (line 171))

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:

ut_event_manager.trigger_event(ut_event_manager.gc_initialize, ut_run());

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@martin-bach-oracle
fix: prevent ora-21799 in ut_runner
15b1ab7
@lwasylow

lwasylow commented Apr 21, 2026

Copy link
Copy Markdown
Member

Hi @martin-bach-oracle
We have put a fix as part of #1310
Could you give it a shot using a develop source code branch?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal

jgebal commented Apr 21, 2026

Copy link
Copy Markdown
Member

Hi @martin-bach-oracle

We also faced the same issue recently and a fix is already merged into develop branch.
There was a comment about it here:
#1309 (comment)

The fix that we have applied can be found here:
https://github.com/utPLSQL/utPLSQL/pull/1310/changes#diff-5725a92b6cb359b9213a9b3390c253f930d04d9072f89c7bec1c6717aba48e07R168

I will prepare new intermediate release of utPLSQL framework, java-api and utPLSQL-cli, to give them a small refresh.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@martin-bach-oracle

martin-bach-oracle commented Apr 22, 2026

Copy link
Copy Markdown
Author

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 ut_runner?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal

jgebal commented Apr 22, 2026

Copy link
Copy Markdown
Member

I will investigate and let you know.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal

jgebal commented Apr 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@martin-bach-oracle
I checked the utPLSQL code for all references to ut_event_manager.trigger_event
There are multiple instances where we internaly call ut_event_manager.trigger_event without the second parameter.
Passing an empty ut_run() object is more like a hack/workaround then a solution as empty ut_run() object does not represent the context of current utPLSQL test run that is executed.
In some cases that context is not relevant and not needed.
This is why the second arcument of the procedure ut_event_manager.trigger_event is optional and defaults to null.

In general, optional NULL argument is correct functionality but the behavior of this peice of code was unstable.
treat(a_event_item as ut_run)

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 treat(l_event_item as ut_run) alltogether in cases when l_event_item is NULL.

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@martin-bach-oracle

martin-bach-oracle commented Apr 22, 2026

Copy link
Copy Markdown
Author

no worries, feel free to close the PR in that case

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal

jgebal commented Apr 22, 2026

Copy link
Copy Markdown
Member

Thank you @martin-bach-oracle also for your feedback on oracle forum.

New releases should be available soon.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgebal jgebal closed this Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@martin-bach-oracle @lwasylow @jgebal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.