This is not an answer but a scenario in which it is required to recreate the session within the execution of a pl/sql. In this scenario the execution and update of some packages from my pl/sql code has created a lock on one of my java classes (a class level lock). And it seems that the only way to release that lock is by closing the session that created in the 1st place (my session). Perhaps the question is "is there any other way to release a java class level lock than closing the session that created the lock?"