Skip to Content
0
Former Member
May 15, 2010 at 07:25 AM

a question on how to avoid duplicate with number_get_next

436 Views

hi all,

i'm thinking to use NUMBER_GET_NEXT to generate unique number. To ensure there is no duplicate,

i use enqueue and dequeue to get the number from SAP.

number_range_enqueue

number_get_next

number_range_dequeue

Now the question is do we really need number_range_enqueue and number_range_dequeue to avoid getting duplicate number from number_get_next (when number_get_next) is access simultaneously.

If happen the calling of number_range_enqueue is fail due to multiple access(lock) at the same time, we have the option to write system message and the process will stop there.

Is it advisable to do a recursive call of the number_range_enqueue when it is fail, so user don't see the error message and wait till to acquire the next available lock? Will this recursive call cause a dead lock?