3 Replies Latest reply on Jul 24, 2013 5:06 PM by lucassampsouza

    Share Apex collection between applications in same session

    Tony Andrews
      I would like to be able to populate an Apex collection in one application, and then access it from another (in the same Apex session). However, it appears that Apex collections cannot be accessed other than by the app you are in when you create them. Is there a way to get around this limitation, short of building my own equivalent functionality?
        • 1. Re: Share Apex collection between applications in same session

          There isn't any direct way to circumvent this restriction - the underlying database view for collections is intentionally constrained by current application ID. Really no different than scalar session state.

          • 3. Re: Share Apex collection between applications in same session

            Has one very wrong way,hehehe, just create a new view with this code:


            create or replace view apex_040200.apex_collections_session$ as

            select c.collection_name, m.seq_id, m.c001, m.c002, m.c003, m.c004, m.c005, m.c006, m.c007,

                                                                 m.c008, m.c009, m.c010, m.c011, m.c012, m.c013, m.c014, m.c015, m.c016, m.c017,

                                                                 m.c018, m.c019, m.c020, m.c021, m.c022, m.c023, m.c024, m.c025, m.c026, m.c027,

                                                                 m.c028, m.c029, m.c030, m.c031, m.c032, m.c033, m.c034, m.c035, m.c036, m.c037,

                                                                 m.c038, m.c039, m.c040, m.c041, m.c042, m.c043, m.c044, m.c045, m.c046, m.c047,

                                                                 m.c048, m.c049, m.c050, m.clob001, m.blob001, m.xmltype001, m.n001, m.n002, m.n003,

                                                                 m.n004, m.n005, m.d001, m.d002, m.d003, m.d004, m.d005, m.md5_original

                                                              from wwv_flow_collections$ c, wwv_flow_collection_members$ m

                                                                where c.session_id = (select v('SESSION') from dual)

                                                               and c.security_group_id = (select wwv_flow.get_sgid from dual)

                                                               and c.id = m.collection_id


            create public synonym apex_collections_session for apex_040200.apex_collections_session$;


            grant select on apex_collections_session to public;



            this works because the APEX_COLLECTIONS is a synonym to "wwv_flow_collections" view, and this query I saw using this query:

            select * from dba_views where view_name = upper('wwv_flow_collections');


            I am not responsible for the use of this code. hehehehehehhehe