Posts

Lock-Based Protocol in DBMS

Image
  Lock-Based Protocol In this type of protocol, any transaction cannot read or write data until it acquires an appropriate lock on it. There are two types of lock: 1. Shared lock: It is also known as a Read-only lock. In a shared lock, the data item can only read by the transaction. It can be shared between the transactions because when the transaction holds a lock, then it can't update the data on the data item. 2. Exclusive lock: In the exclusive lock, the data item can be both reads as well as written by the transaction. This lock is exclusive, and in this lock, multiple transactions do not modify the same data simultaneously. There are four types of lock protocols available: 1. Simplistic lock protocol It is the simplest way of locking the data while transaction. Simplistic lock-based protocols allow all the transactions to get the lock on the data before insert or delete or update on it. It will unlock the data item after completing the transaction. 2. Pre-claiming Lock Protoc...

RMI in java

Image
  Remote Method Invocation in Java Remote Method Invocation (RMI) is an API that allows an object to invoke a method on an object that exists in another address space, which could be on the same machine or on a remote machine. Through RMI, an object running in a JVM present on a computer (Client-side) can invoke methods on an object present in another JVM (Server-side). RMI creates a public remote server object that enables client and server-side communications through simple method calls on the server object. Stub Object:  The stub object on the client machine builds an information block and sends this information to the server. The block consists of An identifier of the remote object to be used Method name which is to be invoked Parameters to the remote JVM Skeleton Object:  The skeleton object passes the request from the stub object to the remote object. It performs the following tasks It calls the desired method on the real object present on the server. It forwards th...