ORA-04021: timeout occurred while waiting to lock object

From: <ahmed.fikri_at_t-online.de>
Date: Tue, 7 Sep 2021 10:07:46 +0200 (CEST)
Message-ID: <1631002066323.628376.9d7dc4b23ba6c7e2f884f3f4483692002ff69e16_at_spica.telekom.de>



Hi all,  

Have the following situation:

-Java Class CLASS_A defined in the schema SCHEMA_A
-execute privilege is granted to SCHEMA_B
-A long-running job is running in SCHEMA_B, at some point the CLASS_A
will be used in this long-running job.  

While the long-running job is still running, I try to grant execute privilege to SCHEMA_C, this action resulted in the error ORA-04021: timeout occurred while waiting to lock object.
In th gv$session I saw that the grant is blocked by the session of the long-running job. I think it makes sense that oracle try to ensure that CLASS_A will not be dropped while the grant action.

But is it not exaggerated that oracle prevents the grant while the class is only in use? I observed this only for java classes, packages and functions do not have this restriction.  

Best regards
Ahmed


--
http://www.freelists.org/webpage/oracle-l
Received on Tue Sep 07 2021 - 10:07:46 CEST

Original text of this message