My Oracle Support Banner

Sapurge Program "Delete_store_day_data" get_lock Function Question (Doc ID 1213644.1)

Last updated on DECEMBER 04, 2019

Applies to:

Oracle Retail Merchandising System - Version 12.0.8 and later
Information in this document applies to any platform.

Goal

In the SAPURGE program, "delete_store_day_data" function, on line 11 (see below code), it calls "get_lock".
If that is successful, then the SA_STORE_DAY table is updated with the purging code ('G') for the store_day_seq_no being processed. (line 15)
It then performs "retek_force_commit", updating the bookmarks. (line 22)
If that succeeds, it calls "get_lock" again for the same store_day_seq_no. (line 26)

Question: Won't this 'second' call to the "get_lock" ALWAYS fail since the first call to "get_lock' already locked the record?

1 int delete_store_day_data(char is_store_day_seq_no[NULL_BIG_SEQ_NO],
2 char is_store[NULL_STORE],
3 char is_day[NULL_DAY],
4 char is_rowid[NULL_ROWID])
5 {
6 char* function = "delete_store_day_data";
7
8 int li_function_ret = 0;
9
10 /* we proceed ONLY if we were able to get a lock */
11 if (get_lock(is_store_day_seq_no,
12 "", SALT_W, ps_error_message) == 0)
13 {
14 /* Update status to purgin'G' */
15 EXEC SQL
16 UPDATE sa_store_day
17 SET data_status = :SADS_G
18 WHERE store_day_seq_no = TO_NUMBER(:is_store_day_seq_no)
19 AND store = TO_NUMBER(:is_store)
20 AND day = TO_NUMBER(:is_day);
21
22 if (retek_force_commit(2,
23 is_store_day_seq_no,
24 function) < 0)
25 return(-1);
26 if (get_lock(is_store_day_seq_no,
27 "", SALT_W, ps_error_message) != 0)
28 return(1);

Solution

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Goal
Solution


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.