Skip to Main Content

APEX

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!

How to get around APEX Collection Unique Constraint error?

roobieJun 16 2014 — edited Jun 18 2014

Hi,

Ref: APEX 4.2.4.00.08

I have jQuery code to grab data from a Report (based on a read-only view) and send them to an on-demand process which then add data into an APEX Collection. Adding one Report row at a time is no problem but when add multiple records I run into this error:

unique constraint (APEX_040200.WWV_FLOW_COLLECTION_MEMBERS_PK) violated

I am not sure why this happens.

I am using APEX JAVASCRIPT API to send data to the on-demand process.

var f01Arr = new Array();

f01Arr.push("VAL1");

f01Arr.push("VAL2");

apex.server.process(

       serverProcessName,

     {

     x01: 1,

     x02: 2,

     ..

     ..

     x07: 'some text',

     f01: f01Arr

     },

     {

          dataType: "text",

           success: function(pData) {

           console.log("Result: "+pData);

     }

});

    APEX_COLLECTION.ADD_MEMBER (

       p_collection_name => p_collection_name,

       p_c001            => p_1,

       p_c002            => p_2,

       p_c003            => p_3,

       ...

       ...

       --p_generate_md5    => 'YES'       );


NOTE: this error does not happen all the time but most of the time

I suspect it is to do with the timing.

Is it possible to make apex.server.process synchronous?

Has anyone come across this issue? Please advise how to avoid it

Thanks & regards

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2014
Added on Jun 16 2014
2 comments
1,804 views