RESET_STATE vs DBMS_SESSION.MODIFY_PACKAGE_STATE (DBMS_SESSION.REINITIALIZE)
Thank you for taking my question. We're getting ready for 23ai and see that there is a new RESET_STATE option we can use if we're using PL/SQL behind a web server connected to Oracle using a connection pool and serving up stateless services. (https://docs.oracle.com/en/database/oracle/oracle-database/23/adfns/high-availability.html#GUID-F7E968E4-EE8F-4563-91F3-CD44B5D2E747) Up until now on 12.1.0.2 we've been running the following each time we return the connection to the pool to make sure we're not leaking data between calls: <code> begin dbms_session.modify_package_state ( dbms_session.reinitialize ); end; </code> It's always our top CPU consumer on the database. With that in mind... 1. Is RESET_STATE less demanding CPU wise than dbms_session.modify_package_state ( dbms_session.reinitialize )? 2. Was dbms_session.modify_package_state ( dbms_session.reinitialize ) the right way to go to prevent session state leaks on 12.1 or was there a better way?
RESET_STATE vs DBMS_SESSION.MODIFY_PACKAGE_STATE (DBMS_SESSION.REINITIALIZE)