Forum Stats

  • 3,838,655 Users
  • 2,262,389 Discussions
  • 7,900,724 Comments

Discussions

What is a "persistent item"?

Eric Olson 1
Eric Olson 1 Member Posts: 77 Bronze Badge
edited Sep 27, 2018 3:20PM in APEX Discussions

I've just finished debugging a strange problem in a page process that was giving incorrect results because a page item had the wrong value. We discovered this page item value was getting set as soon as the user's session was created and even before he loaded that page. The V() function would return a value for this item even when there was no value in WWV_FLOW_DATA.

Eventually, I turned on session tracing and found this when V('P1_ITEM') was being called:

SELECT ATTRIBUTE_VALUE FROM WWV_FLOW_PREFERENCES$ WHERE USER_ID=:B3 AND SECURITY_GROUP_ID = :B2 AND PREFERENCE_NAME = 'PERSISTENT_ITEM_'||:B1

There was indeed a value in WWV_FLOW_PREFERENCES$ for PERSISTENT_ITEM_P1_ITEM. We don't really use preferences except for the usual built in report sorting and this "persistent_item" type of preference is new to me. Even when I deliberately set a preference (apex_util.set_preference), it does not add this prefix.

I can't find anything in the documentation on this. Does anyone know what this might be?

This is on Apex 5.1.2.

Tagged:

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    edited Sep 27, 2018 2:30PM Answer ✓
    eaolson1 wrote:I've just finished debugging a strange problem in a page process that was giving incorrect results because a page item had the wrong value. We discovered this page item value was getting set as soon as the user's session was created and even before he loaded that page. The V() function would return a value for this item even when there was no value in WWV_FLOW_DATA.Eventually, I turned on session tracing and found this when V('P1_ITEM') was being called:SELECT ATTRIBUTE_VALUE FROM WWV_FLOW_PREFERENCES$ WHERE USER_ID=:B3 AND SECURITY_GROUP_ID = :B2 AND PREFERENCE_NAME = 'PERSISTENT_ITEM_'||:B1There was indeed a value in WWV_FLOW_PREFERENCES$ for PERSISTENT_ITEM_P1_ITEM. We don't really use preferences except for the usual built in report sorting and this "persistent_item" type of preference is new to me. Even when I deliberately set a preference (apex_util.set_preference), it does not add this prefix.I can't find anything in the documentation on this. Does anyone know what this might be?This is on Apex 5.1.2.

    This is how values are persistently stored for page items where the Maintain Session State property is set to Per User.

    This may have been set in error as it is an uncommon but occasionally useful feature.

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 21,101 Red Diamond
    edited Sep 27, 2018 2:30PM Answer ✓
    eaolson1 wrote:I've just finished debugging a strange problem in a page process that was giving incorrect results because a page item had the wrong value. We discovered this page item value was getting set as soon as the user's session was created and even before he loaded that page. The V() function would return a value for this item even when there was no value in WWV_FLOW_DATA.Eventually, I turned on session tracing and found this when V('P1_ITEM') was being called:SELECT ATTRIBUTE_VALUE FROM WWV_FLOW_PREFERENCES$ WHERE USER_ID=:B3 AND SECURITY_GROUP_ID = :B2 AND PREFERENCE_NAME = 'PERSISTENT_ITEM_'||:B1There was indeed a value in WWV_FLOW_PREFERENCES$ for PERSISTENT_ITEM_P1_ITEM. We don't really use preferences except for the usual built in report sorting and this "persistent_item" type of preference is new to me. Even when I deliberately set a preference (apex_util.set_preference), it does not add this prefix.I can't find anything in the documentation on this. Does anyone know what this might be?This is on Apex 5.1.2.

    This is how values are persistently stored for page items where the Maintain Session State property is set to Per User.

    This may have been set in error as it is an uncommon but occasionally useful feature.

  • Eric Olson 1
    Eric Olson 1 Member Posts: 77 Bronze Badge
    edited Sep 27, 2018 3:20PM

    That must have been what happened. It appears in 5.2 if the item is changed back to Per Session, the preferences remain, and the V() function can retrieve the preference rather than the page item value. As far as I can tell, this has been fixed in 18.2, at least in testing on apex.oracle.com.

This discussion has been closed.