Posts

Showing posts from March, 2017

Assignment 2 [DD] last date is 3/4/2017

December 2015 1.  Give two applications of XML 2.  Describe Query processing in Distributed Database ** 3.  Describe 3 Phase Commit protocol / Algorithm ** 4.  Explain 2 concurrency control algorithm for  Distributed Database ** 5.  What are the issues of query processing in heterogeneous database 6.  Explain Distributed Deadlock Management ** 7.  Explain Distributed Database Architecture **  ********************************************************************************** May 2015 8.  What is Query Optimization? List distributed query processing algorithm and explain any one from that. 9.  Describe any two methods for deadlock detection in distributed database 10.  Explain time stamp based concurrency control mechanism in DDB ** 11.  State the purpose  of 2 Phase Commit protocol. Explain 2PC in details  ********************************************************************************** May 2016 12.  What are the Objectives of Distributed Query

Implementation of 2PL Protocol in java

Implementation of 2PL Protocol in java. import java.io.*; import java.util.*; class Account {     String name;     int amount,lock;         Account(String name,int amount,int lock)     {     this.name=name;     this.amount=amount;     this.lock=lock;     }         public void deposit(int amt)     {         amount +=amt;     }         public void withdraw(int amt)     {         if((amount-amt)<0)         {             System.out.println("Transaction Cannot proceed : Not Enough Balance in Account"+name);             System.exit(0);         }         amount -=amt;             }         public int balance()     {         return amount;     } } class Transaction implements Runnable {     private Thread t=null;     String id;     Account from,to;     int amount;             Transaction(String id,Account from,Account to,int amount)     {         this.id=id;         this.from=from;         this.to=to;         this.amount=amount;     }     public void acquireLock(Account x,int