Reputation: 5873
I have an Oracle package that is often being revised. When I call this package after an edit to the package , Oracle throws ORA-04068: existing state of packages has been discarded. Although it runs ok on subsequent calls, this is an annoying experience. Is there a way to avoid this message being thrown on the first call to the package that has be compiled.
I am calling the package via WCF/ODP.NET 4.121.1.0 connected to Oracle 11G.
Upvotes: 1
Views: 576
Reputation: 98
If you have package variables which are only needed for one call and you don't need to keep the values between calls you could use the SERIALLY_REUSABLE Pragma. You can find details here: http://docs.oracle.com/cd/B14117_01/appdev.101/b10807/13_elems046.htm
If you need to edit the logic of the package but the types and names of the variables stay constant you could just put them in another package. It's not beatifull but works.
Upvotes: 1