An ORA-4020 occurs when a session tries to lock a library object and a deadlock is detected. It mostly occur during the compilation of packages/triggers/views or the executions of DDL statements. It sometimes can happen after an software upgrade due to the invalidations of database objects and the required revalidation of them when you start to use them.
In general, the first thing to control when you get an ORA-4020 is to see if they are invalid objects used, and try to recompile/validate them. Secondly, control if DDL commands are executed by different sessions at the same time, and serialize this processing.
It is better to ask and appear ignorant, than to remain silent and remain ignorant.
Oracle OCP DBA 9i,
C++, Java developer