Library cache pin wait event on a pakage
We have a 19.17 database and recently we saw a "library cache pin" wait event and the object related to that was a package body. The wait event got resolved by itself in 10 min or so but during those 10 minutes there was a huge spike in the concurrency wait and lots of sessions were waiting. The issue / contention started at 9 AM and was resolved by 9.10 AM
So we have 2 questions
- What could cause such a lock / wait event?Can it happen if multiple sessions are trying to EXECUTE that package? OR it can only happen if one session was trying to alter that package or modify it and only that will place that lock / pin on that object and all other sessions trying to execute that package will need to wait until session # 1 finish compiling it?