- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All Topicswhat is the difference between these two
and how to trouble shoot the locks ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: mass2612Posted on 2009-04-15 at 01:29:21ID: 24145777
Hi,
I'm prepared to try to explain this as best I can. SAP locks are managed by SAP itself also known as the SAP enqueue whilst Database locks are managed by your database lock handler.
Database locks are set by data changing SQL statements such as update, insert, delete, etc and held until the SQL statement commit is called and then the DB lock is released.
In a SAP transaction there can be multiple steps, after each step the SAP work process triggers a commit (or rollback if a rollback is executed it also releases all DB locks) therefore reducing the time that a DB lock is in place. Sometimes however this type of locking is not sufficient for a SAP system or trasnaction and therefore the SAP lock was designed.
A SAP lock is a logical lock that acts only within the SAP system. If the SAP locking system the SAP enqueue locks a table or row then it can still be changed by a SQL statement that executes directly on the database and not through the SAP enqueue convention.
Therefore if a transaction has many steps to it such as booking a holiday (first you need flights, then a hotel, then a car, etc if you can't get a flight you don't want the hotel or if you can't get a hotel you don't want a flight). If you follow this example in the SAP transaction each component i.e. flight, hotel, car is treated as a SAP LUW and locked via a SAP lock in the enqueue system and stored in special update tables. Once the entire transaction is complete the enqueue system sends a request to the update work process which then transfers the updates to the database system. Once the DB has been updated the enqueue then releases the SAP locks.
When a developer develops a report or program they should write the program so that locks are only created as late as possible to reduce database waits due to locking. Performance problems can occur if the lock is held too long or not released.
You can monitor Database locks via transaction DB01 and ST04.
You can monitor SAP locks (enqueue) via transaction SM12.
This is a big topic and for specifics you need to look in SAP notes or contact SAP directly most of the time or if the problem is in a new program or report talk to the developer.