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.