What is an optimistic locking ?
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers

 Q1. What is an optimistic locking ?Database
Ans. It's the way for synchronization wherein we can store version information in the table , so that if the same entity is updated by two transactions, the last to commit changes is informed of the conflict, and does not override the other transaction's work.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     locking  optimistic locking  Synchronization


Related Questions

  What is a BlockingQueue?
 What is the difference between these two approaches of creating singleton Class ?

//Double Checked Locking Code
public static Singleton createInstance() {
   if(singleton == null){
      synchronized(Singleton.class) {
         if(singleton == null) {
            singleton = new Singleton();
         }
      }
   }
   return singleton;
}

//Single checked locking code
public static Singleton createInstance() {
   synchronized(Singleton.class) {
      if(singleton == null) {
         singleton = new Singleton();
      }
   }
   return singleton;
}
 What could be the possible cause for following exception ?

org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect):

What could be the way to fix it ?
 What is a BlockingQueue ?
 Can the double checked locking fail on single processor system ?
 Implement a thread-safe (blocking) queue
 What is the difference between subscribe and blockingSubscribe method ?
 What is optimistic and pessimistic locking ?
 How to build a blocking queue ?



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: