I would like to know what is the difference between this: :P10 := :P10 and this: apex_util.set_session_state('P10', :P10)
I know this self-assignment looks strange, but it gives a different result in my app, I can't figure out why and can't find any place for the different behavior. Thanks
1 Answer
Both do the same, they set the value of a page item in the apex session. However, if you use them mixed, then this might cause issues since the order is which they are executed does not guarantee the order in which they are set in the session. There was a talk at a conference by Dimitri Gielis on this subject last year and this is the only thing I remember from that talk. So... don't mix them. Personally I only use apex_util.set_session_state when I dynamically have to set the item values (example:
FOR r IN 1 .. 10 LOOP apex_util.set_session_state('P10_ITEM'||r, r); END LOOP;