Tuesday, August 30, 2011

B2B Batching of transactions not happening

Scenario:- We had to batch all the EDI outgoing transactions for a particular trading partner 's particular EDI transaction. For eg- Lets say we have 100 invoices(810) coming from EBiz/SOA into B2B for trading partner 'A' in one transaction.Now we have to club all the 100 invoices into one EDI file and send it to 'A'.

Problem:- I won't discuss how batching is done in B2B. You can get the complete details in this below link
http://www.oracle.com/technology/products/integration/b2b/pdf/B2B_TN_012_EDI_OutBound_Batching.pdf
We faced an issue where even after applying the logic correctly, the batching was not happening.The transactions remained in the WAIT BATCH state forever in the B2B console.Even if we bounced the B2B server, neither the existing transactions were completed nor the new transactions were batched.
The interesting part was that it was happening only in one of b2b instances because it was working perfectly in another b2b instance which meant that my batching logic was correct.

Cause:- After doing some research in the b2b database, we found that the parameter "job_queue_processes" which specifies the no. of processes allocated to run the "ip_b2b_dbms_job" was significantly low , in fact the value was 0.
This parameter can be seen using sqlplus 'show parameter job_queue_processes'. The sample pl/sql code is as below:
CREATE or REPLACE PROCEDURE ip_b2b_dbms_job AS
x NUMBER;
BEGIN
dbms_job.submit(x, 'B2B_TIMEOUT_PROC;', sysdate, 'sysdate + (1 / 1440)');
commit;
END;

Solution:- We need to increase it's value to 5 or 10 and then bounce the B2B DB and Server.
This worked!!

Regards
Ayush

1 comment:

anew said...

Hi,

i am also facing the same issue in our prod system sometimes batching works well and sometimes it shows wait batch state,
earlier very few times i saw in our test system , that time i thought may be some db problem ,but now i see it's some how related to batching only.

I have already followed the steps-
http://www.oracle.com/technology/products/integration/b2b/pdf/B2B_TN_012_EDI_OutBound_Batching.pdf

and
i already have job_queue_processes parameter = 10

any other suggestions ?

Br,
anew