What is the difference between an explicit and an implicit lock in database?
Asked Answered
I

3

8

What is the difference between an explicit and an implicit lock in database?

Ives answered 8/9, 2010 at 19:55 Comment(0)
H
2

Implicit locks are generally placed by the DBMS automatically. Most DBMS allow the developer or the application to issue locks which are referred to as explicit locks.

Heavyweight answered 8/9, 2010 at 20:27 Comment(0)
I
2

Implicit Locking

Objectivity/DB will implicitly obtain the appropriate locks for your application at the point at which they are needed. An operation that reads an object will obtain a read lock; an operation that modifies an object will obtain a write lock.

Explicit Locking

Implicit locking obtains access rights to resources as they are needed by an application. In general, the automatic locking by Objectivity/DB provides a level of federated database concurrency that is sufficient for most applications.

Some applications, however, may need to reserve access to all required resources in advance. Reasons for doing so might be to secure required access rights to the necessary objects before beginning an operation, or to prevent other sessions from modifying objects critical to the operation.

An application needing to reserve access to all required objects in advance can explicitly lock objects. Suppose an application needs to calculate a value based upon the state of many objects at a specific point in time. Although the application cannot check all of the necessary objects simultaneously, it can achieve the same effect by freezing the state of the objects and then checking them in sequence. Explicit locking effectively freezes the objects, because no other session can modify them as long as they are locked.

Imogene answered 27/1, 2014 at 12:16 Comment(0)
A
0
  • Explicit Lock: - Lock is explicitly requested for a record or table.
  • Implicit Lock: - Lock is implied but is not acquired
Anabolite answered 16/11, 2012 at 14:7 Comment(1)
A more explicit explanation would be useful. What does "not aquired" mean in this context?Pahang

© 2022 - 2024 — McMap. All rights reserved.