Enqueue/Dequeue
Hi,
There are 2 reports accessing 1 table. I am facing the runtime error with description - "The database system detected a deadlock and avoided it by rolling back your transaction.u201D
Have come across implementing the ENQUEUE and DEQUEUE concept on the table. Please clarify the below queries:
1.Is the above error occuring beacuse the two reports are accessing the table at the same time?
2.Implementing EN/DEQUEUE will solve the problem?
3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?
Regards,
Rajkamal
Hello Raj,
You should understand the difference between Database Locks & SAP locks.
The database system detected a deadlock and avoided it by rolling back your transaction
1.Is the above error occuring beacuse the two reports are accessing the table at the same time?
Initial look at the statement suggests that this is because of Database Lock collision. You need to check if both the programs were trying to write (INSERT/UPDATE/MODIFY/DELETE) the same data to the DB table.
2. Implementing EN/DEQUEUE will solve the problem?
It should. But make sure you don't lock the entire table, try to lock only the individual records which are being processed(This is a good coding practice, of course you can override it depending on your requirement).
3.If first report is writing the data to table at 12pm(after locking the table), and the second report trying to access the table at 12:10pm to write the data, will this wait in some queue and write the data after the first report releases the table lock?
No, afiak there is no such queue. Alternatively you can put the lock in a iteration(viz., DO loop, WHILE loop) & check when the locks are released.
Hope i'm clear.
BR,
Suhas
Similar Messages
-
Query on sap locks(ENQUEUE/DEQUEUE)
Hi All,
should the sap locks ENQUEUE/DEQUEUE need to be used for all the updation/insertion of records ino the table?
Please confirm.Should this locking technique be used even for insertion of records into the table?
Regards,
Pra.Hi,
Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
SAP Provide three type of Lock objects.
- Read Lock(Shared Locked)
protects read access to an object. The read lock allows other transactions read access but not write access to
the locked area of the table
- Write Lock(exclusive lock)
protects write access to an object. The write lock allows other transactions neither read nor write access to
the locked area of the table.
- Enhanced write lock (exclusive lock without cumulating)
works like a write lock except that the enhanced write lock also protects from further accesses from the
same transaction.
You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
Hope this will give a basic idea. -
Issue with Enqueue / Dequeue
We are working on a scenario where data is got into SAP through Web methods to create Sales orders.
If we were to use Enqueue / Dequeue function while doing this would the web methods connection hold till the process is complete or would this time out in the middle?
Is there any time out period for the connection with web methods, and if so how can it can be reset to an alternate valueHi,
in ITS if you click on object, you can see the parmaters like
~TRANSACTION
<b>~TIMEOUT</b>
give more time for Time out parameter, that should solve the problem.
Regards
Vijay D T T. -
2515 Locking FMs to Enqueue/Dequeue/ Which one to use?
I know this question is redundant, and has been responded to a million times....all differently. However, being their are 2,515 function modules to choose from, what are the best choices for locking and unlocking a custom database table?
And, why are their 2,515 of them?
I take that back....many many more!
Thank-You
Edited by: Tom Matys on Sep 23, 2011 12:15 PMHi
I think the best way is to create a new lock object for every custom tables.
Every table should have an own lock object (so own fms to Enqueue/Dequeue) because it makes sure the same lock object is not used for another table at the same time.
If the same lock object is used for many tables it can risk to find a certain record locked although nobody locks it really.
Max -
What is AQ Enqueue/Dequeue
Hi ,
Can anybody explain me the concept of AQ Enqueue/Dequeue
I google and read the document but no get clear picture
Thanks in AdvanceCheck this link.
http://www.oracle-developer.net/display.php?id=319
>
I google and read the document but no get clear picture
>
Which document you read and what is not clear ? Try to be more precise and to the point in your questions. It will help you a lot in a getting quick and meaningful answers.
thanks
Raj -
Finding Enqueue/Dequeue functions
Hi,
Is there an easy way to find the enqueue/dequeue lock functions for a specific table?
I tried to find the enqueue/dequeue functions for table LIKP. It took me a while to find it, but it turns out the name is ENQUEUE_EVVBLKE.
You'd think that the table name would be incorporated into the function name to make it easy to find?!
Does anyone have a suggestion?
Thx.
AndyYes bro most of the times the table or field names would be in the Function module name.
Raghav -
I hav designed a new application for store i wish to enqueue & dequeue materials which store persons are using.
So how can this be done.Please guide once i open any material in my applcation its locked untill i come out my application.I wishto unclock as my processing is over.
Pls guide whch FM to use.hi,
Create a lock object from SE11 by giving the name
lock object : ezlock_material.
call the function module enqueu_ezlock in th loop to which to all the materials to lock.
to lock the material
call the function module dequeu_ezlock in th unloop to which to all the materials to unlock.
to unlock the material.
Regards,
Madhavi -
JMS Enqueue/Dequeue without using oracle.jms package
Hi,
Is it possible to successfully enqueue/dequeue messages from Oracle AQ using JMS which only uses the classes under javax.jms package, not the classes under oracle.jms package. If possible, can anybody please provide some step by step example.
ThanksYou can get the connection factory and the queue from an application server's jndi. Create a resource provider reference in oc4j and get them from there. Read the oc4j services guide, oems (jms) chapter for how to do that.
I think if you are not using an application server you can also get the connection factory and queue from an ldap directory. check out Aq user guide for that. -
Enqueue/Dequeue - Locking/Unlocking object
Hi all,
Please help me working with this enqueue/dequeue command. What I'm trying to do is to lock a Service Order. My requirement is to do a BDC for the Service Order Settlement Rule. So after hitting SAVE, a secondary process will be kicked off to perform my BDC for the same order. Now what Im doubting is that what if user re-enter the same Service Order again so quick. So my BDC program will not be performed immediately since it will be locked by the usser.
So my idea is to lock it first while my BDC program is still running. Any help please? Thanks.Nope. Just 1 BDC -on my 2nd program only. Or to make it simple, I have modified ZXWOCU07 (IWO10009) to perform/kick off a call function( this is being triggered after hitting on SAVE). And this FM contains my checking if SO is now open for change then do the do the BDC.
What I'm thinking is to lock first the SO to block any user from accessing that SO, so it will do the BDC first. But I'm not yet familiar with the locking/unlocking of objects. Please help me on how to use enqueue or locking object. -
Enqueue/Dequeue in Oracle Aq Adapter
Hi,
I need to use enqueue/dequeue option in oracle aq adapter.
However i need to know how the macthing of ids has to happen.
Can any one provide me with an example with details steps?
Thanks,
RoshThe below url will provide information about AQ adapter,
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_aq.htm
Example of AQ adapter.
http://jamessmith73.wordpress.com/oracle-fusion-middleware/oracle-soa-bpm-11g-blogs/soa-10g/soa-hands-on-4/
Thanks,
Vijay -
Lock specific number of records using ENQUEUE & DEQUEUE
Hi,
Is it possible to lock a group of records in R/3?
My requirement is to update a set of records in VBAP table. I'm not using a BAPI here. Instead, I use a direct UPDATE.
In this case, i know i can lock individual records by passing VBELN and POSNR. But what if i have to lock 10 records?
Is this possible in any way?
Thanks in advance.
The current solution is:
1) LOOP at ITAB
2) LOCK each entry
3) UPDATE VBAP for that entry
4) UNLOCK the entry
5) Endloop
I thought this solution might work: (Assume 10 records are present in ITAB)
1) LOOP at ITAB (Lock all 10 entries)
2) LOCK that entry
3) ENDLOOP
4) UPDATE VBAP from ITAB (Updates all 10 entries in one databae access)
5) LOOP at ITAB(Unlock all 10 entries)
6) UNLOCK that entry
7) ENDLOOP
Any help will be appreciated.
Tabraiz.Hello,
Both of your solutions will work.
With solution 1 there will always be only 1 enqueue object created, because you always enqueue, perform the update and dequeue.
This means that in SM12 you will only see 1 enqueue entry on your user ID at the same time when your program runs.
Solution 2 is also possible but there you will have different enqueue objects that will be created, because you enqueue everything, then perform the updates and then dequeue everything.
In SM12 (lock entries) this will result in more enqueue records on your user ID the time your program runs.
You have to pay attention that lock entries (SM12) are stored in a queue that is limited, so make sure with solution 2 that you don't overflow the enqueue queue ! ! !
Via tcode RZ11 you can check parameter enque/table_size (Size of lock table).
Check the parameter value but also its documentation and you will understand why you should limit the number of open lock records.
Success.
Wim Van den Wyngaert -
Enqueue/ Dequeue Table record
Dear Experts,
I am updating a record in my z-table which is appended in LFA1 through a Z-program.
Prior to my update command i want to Enqueue that particular record and once it is updated i want to dequeue it.
Can you please suggest the function module to perform this.
Best Regards
Ankur GuptaHi
You this FMs.
ENQUEUE_E_TABLE
DEQUEUE_E_TABLE
The type of locks used in these are explained in the link below.
http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm -
How to use Enqueue/Dequeue to prevent concurrent write?
Hi All,
I have a report program that allows multiple users to save to the database tables.
How do I incorporate ENQUEUE and DEQUEUE statements to prevent concurrent write to ensure data integrity? Are there sample codes that I could refer to?
ThanksHi,
here screen get locked
CALL FUNCTION 'ENQUEUE_EIQMEL'
EXPORTING
mandt = sy-mandt
qmnum = i_final_ap-qmnum -Notification number
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
*--Setting the task "PE03" for notification on screen
CALL FUNCTION 'IQS4_ADD_DATA_NOTIFICATION'
EXPORTING
i_qmnum = i_final_ap-qmnum
i_conv = ' '
i_post = c_x
i_commit = c_x
i_wait = c_x
TABLES
i_viqmsm_t = i_viqmsm_tmp
return = i_return.
CALL FUNCTION 'DEQUEUE_EIQMEL'
EXPORTING
mandt = sy-mandt
qmnum = i_final_ap-qmnum. -
Hi,
How to find enqueue and dequeue rate in Oracle Advanced Queue?
Please post if there is any SQL query to find enqueue per second, dequeue per second.
Regards,
GuruHello,
Can you please show me how to run AWR report so that it generates AQ stats you talked about ?The AWR report will be started using the sql script "awrrpt.sql" ($ORACLE_HOME/rdbms/admin/awrrpt.sql).
You will find all details in the original Oracle documentation, keyword AWR.
In the generated report you will find two sections concerning AQ (including a list of all your defined AQs):
==> Persistent Queues
Ordered by Queue Name
indicates queue (re)started between Begin/End snaps
%Exp Msgs - % of msgs enqueued with expiry
%Delay Msgs - % of msgs enqueued with delay
%Trasf Time - % of Enqueue time spent in transformation
%Eval Time - % of Enqueue time spent in rule evaluation
==> Persistent Queues Rate
Ordered by Queue Name
indicates queue (re)started between Begin/End snaps
Greetings
WoG -
Enqueue/Dequeue is repeating the last queued element
Hello
I am trying to aquire data from a camera at 256fps in one for loop, enqueueing the data after each frame is acquired. A seperate while loop is supposed to dequeue each image and stream it to a binary file, acheiving the maximum imaging speed possible by seperating the data acquisition from the saving routine.
However, this is not happening. The files are being queued and dequeued correctly UNTIL the acquisition for loop reaches completion (for example after 500 cycles) at which point the dequeue VI stops passing successive images to the binary write VI and just sends the last dequeued image over and over again until 500 images have been written to the binary file.
Can anyone suggest why this might be happening?
CheersHi Phoenix,
The queue approach is still the best architecture for your
application. Instead of converting the image to an array, have you tried
flattening each image to a string and passing this into the que?
You can then un-flatten from the string in the non-deterministic loop.
Hope this helps,
John P
John.P | Certified LabVIEW Architect | NI Alliance Member
Maybe you are looking for
-
My music is organized on my computer but the songs under the albums are out of order on my ipod, they weren't before, i've restored, still out of order. what do i do to get them in order?
-
BADI for ME22n - Component Object List
Hi , I am working with transaction ME22n. When the item category is L. The material data tab shows a button called Components (Object List). On clicking this button i am taken to another screen which has childeren material items and the related data.
-
Samsung 1440x900 monitor on a PPC mini
Hi- Usually find me over in the networking area, but I found a good deal on a Samsung 931BW, wide-screen LCD. I'm running a PPC mini 1.25Ghz, Tiger 10.4.8 Has anyone had success on a mini to get 1440x900 resolutino to display properly? Ive looked at
-
Compatibility with multiple inputs
i've been thinking about buying a firewire 1814 (made by m-audio), but i'm curious as to whether it will work with LE 7. especially with an intel-based macbook pro. (i've heard bad stories of people buying these devices but they are not intel compati
-
This is probably a dumb noob question...but I am wanting to remove a couple of app's from my 3GS but they are not showing up in itunes to be "unsynced" so to speak. Any ideas why they wouldn't pull through in to itunes? Thank you!