Data Structures - Interview Questions and Answers for 'Locking' | Search Interview Question - javasearch.buggybread.com
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

   



Data Structures - Interview Questions and Answers for 'Locking' - 4 question(s) found - Order By Newest

 Q1. What is a BlockingQueue?Data Structures
Ans. BlockingQueue is a Queue that supports operations that wait for the queue to become non-empty when retrieving and removing an element, and wait for space to become available in the queue when adding an element.

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

   Like         Discuss         Correct / Improve     blockingqueue   collections   java   concurrent collections     Asked in 10 Companies


 Q2. 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


 Q3. 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 ?
Hibernate
Ans. This looks like the case for optimistic locking wherein hibernate suspects that the information in table was updated by some other transaction after the entity was loaded by current transaction.

One way is to have synchronized entity state and don't detach the entity. Other could be to merge the entity with the table record rather than just directly persisting the entity.

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

   Like         Discuss         Correct / Improve     StaleObjectStateException  Optimistic locking


 Q4. What is a BlockingQueue ?Core Java
 This question is still unanswered. Can you please provide an answer.


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

   Like         Discuss         Correct / Improve     queue  blockingqueue  collections



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: