Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

DEQUEUE

Former Member
0 Kudos

Hi everybody,

Is it allowed to call a DEQUEUE_xxx FM if the corresponding ENQUEUE_xxx failed (e.g. because of a FOREIGN_LOCK)?

Regards, Joerg

6 REPLIES 6

Former Member
0 Kudos

Hi Joerg,

This should not be a problem. As you can see the DEQUEUE FM has no exceptions. This means it will not through an exception is the object was not enqueued first.

Regards,

Arjan.

Former Member
0 Kudos

hi, DEQUEUE can be called even there is no entries has been locked yet.

Actually, in the mutiple lock mode(lock several entries in the same time) I always DEQUEUE all of the records at last, for the safety.

No matter the ENQUEUE is successful or failed.

Former Member
0 Kudos

Hi Joerg,

Calling a DEQUEUE when the ENQUEUE fails is technically allowed. But you must think again as to how much sense it makes in your context. If there has been no ENQUEUE at all, then what is the point in doing the DEQUEUE ?

Typically, however, when you have attempted an ENQUEUE and it fails, you will not go haead with the program till you get the ENQUEUE successful. So, if that is the case, then you can use the DEQUEUE.

Regards,

Anand Mandalika.

0 Kudos

Hi,

Ultimately my question arises from my general lazyness. In my program I first acquire a lock using <b>ENQUEUE...</b> then I call several methods which might throw exceptions. In the <b>CLEANUP</b> section I call <b>DEQUEUE...</b>

So technically the first call (<b>ENQUEUE...</b>) might fail already - in which case the call to <b>DEQUEUE...</b> would be superflous.

However - I have just tried this and simulated a failure - as far as I can tell there haven't been any ill side-effects. However, I generally wouldn't recommend copying my programming style

Regards, Joerg

Former Member
0 Kudos

Poornanand Mandalika

I'm interesting in you reply.

What will happen when we directly call DEQUEUE with no ENQUEUE successed?

Does it has negative impact on our application?

please explain the reason, thanks a lot

0 Kudos

Hi,

I fully agree with Anand.

And as an answer 2 ur question. there wont be any -ve impact other than that u r trying to unlock a record that you didnt lock in the first place.

It is not a good programming practice.

We need to follow some good programming practise too, shouldnt we ?

Prabhu.