2007 Jul 21 9:52 AM
hi
how will u unlock the following
SELECT employee_name FROM employees WHERE employee_id = 123 FOR UPDATE.
i have not created any lock object. i want to lock single record through the above syntax.
after select querry it should get unlock
thanx
rocky
hi
how will u unlock the following
SELECT employee_name FROM employees WHERE employee_id = 123 FOR UPDATE.
i have not created any lock object. i want to lock single record through the above syntax.
after select querry it should get unlock
thanx
rocky
2007 Jul 21 9:54 AM
Hi,
When you use SELECT alon with FOR UPDATE addition the record will be unlocked with the COMMIT WORK tatement. Or when the program is terminated.
When the dialogstep completes there is an utomatic DB commit hat happens so with the commit the record gets unlocked.
Regards,
Sesh
2007 Jul 21 10:24 AM
Hi
Try with this
SELECT employee_name FROM employees
WHERE employee_id = '123' FOR UPDATE.this statement will only unlock
Reward all helpfull answers
Regards
Pavan
2007 Jul 21 11:25 AM
Hi Rocky,
next time please use a subject for your question.
You must SELECT SINGLE if you want to use the FOR UPDATE addition.
Sap online help on SELECT says:
SINGLE
The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
Yes it is possible to lock this way without lock object but you may run into database dead locks causing a dump.
It may be better to check what kinds of locks are set by possibly conflicting transactions and use the same lock objects.
Regards,
Clemens
Regards,
Clemens
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |