03-23-2011 7:22 PM
Hi,
I have a program which is running every 10 minutes in batch mode.
The program would update a Z table with the last record timestamp. The same timestamp would be used for next run of the program as starting time and the end time would be current time.
During at some instancs, the time does not seem to be updated properly and is fetching the same set of records. It is difficult to debug since we dont know when this is happening.
I have used the following function to update my table. Let me know whether i can do anything to make sure it updates.
I think 10 minutes is more than enough for a database update to happen.
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
mode_rstable = c_lock_write
tabname = c_table_zut
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
UPDATE zut_enhanceval FROM TABLE t_defaults.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
tabname = c_table_zut.
Do i need to put commit work at ends of this to make it immediate or is there any issue with my enqueue and dequeue functionality. Please advise as this is causing big production problem
03-23-2011 7:57 PM
I don't see you're handling the situation when ENQUEUE fails. It means you can have all sort of concurrency issues.
03-23-2011 7:57 PM
I don't see you're handling the situation when ENQUEUE fails. It means you can have all sort of concurrency issues.
03-23-2011 9:59 PM
Hi Tom,
I didnt paste the entire code.
I am checking whether the value of sy-subrc eq 0 after the enqueue. Then I am updating the table.
The table is used by various program for reading data and not for updating. Only my program uses that for updating the table.
Regards
Krish
03-24-2011 8:09 AM
03-25-2011 9:15 AM
Hi,
Can you provide some more details?
What are the key fields for your DB table, what is the logic for filling t_defaults, do you check sy-subrc and sy-dbcnt after update?
03-23-2011 8:19 PM
I agree with Tomek, please add a check after ENQUEUE and write a message if check fails...
another thing please check that table is used by another program and previous job finished before starting for current one..
Thanks
04-04-2011 5:19 PM
Hi,
the lock mode is 'X'? (c_lock_write)
Best regards,
Maria João Rocha