Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

"Package Treated as Stateless if State is Constant for Life of Session" - Not true for 11.2.0.4.0

SebastianKoellMar 22 2018 — edited Mar 23 2018

According to this documentation (https://docs.oracle.com/cd/E11882_01/appdev.112/e25519/whatsnew.htm#LNPLS110 ) I understand that a package with only constants would not result in statefullness.

This should be true from 11.2.0.2 and higher.

But in our environment I get ORA-04068 with a Package like this:

create or replace PACKAGE pkg_state
AS
  gv_test constant varchar
(50) := 'Test!';

  
FUNCTION get_variable
  
RETURN VARCHAR2;
END pkg_state;
/

create or replace PACKAGE BODY pkg_state
AS

  
FUNCTION get_variable
  
RETURN VARCHAR2
  
AS
  
BEGIN
  
RETURN 'TRUE';
  
END get_variable;

END pkg_state;
/

This should be a stateless package in my opinion according to the documentation. Still behaves statefull in the following setup:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

"CORE    11.2.0.4.0    Production"

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

Am I missing something?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2018
Added on Mar 22 2018
7 comments
997 views