About lock

manual

Locking in JPA

Explains how to use optimistic locking and pessimistic locking in JPA.... database objects are locked during the transaction and lock conflicts, if they happen, are detected earlier. This page ... Pessimistic Locking Other Explicit Lock Modes Locking during Retrieval ...

 
api-jpa

lock(entity, lockMode)

Lock an entity instance that is contained in the persistence context with the specified lock mode type.(Method of javax.persistence.EntityManager)

 
manual

Setting and Tuning of JPA Queries

Explains various JPA query settings - result range, flush and lock.... Flush Mode (setFlushMode) Lock Mode (setLockMode) Query Hints Result ... is important, this issue has to be considered. Lock Mode (setLockMode) ObjectDB uses automatic optimistic locking ...

 
api-jpa

javax.persistence.EntityManager

Interface used to interact with the persistence context.(Interface of JPA)

 
manual

Chapter 3 - Using JPA

Explains how to store, retrieve, update and delete entity objects using JPA. This chapter explains how to manage ObjectDB databases using the Java Persistence API (JPA). The first two pages introduce basic JPA interfaces and concepts: Database Connection using JPA Working with JPA Entity Objects ...

 
api-jpa

javax.persistence.LockModeType

Lock modes can be specified by means of passing a LockModeType argument to one of the javax.persistence.EntityManager methods that take locks (lock, find, or refresh) or to the Query.setLockMode() or TypedQuery.setLockMode() method.(Enum of JPA)

 
manual

Advanced JPA Topics

Describes advanced JPA topics - detached entity objects, lock management and entity lifecycle events. This section discusses advanced JPA topics: Detached Entity Objects Locking in JPA JPA Lifecycle Events Shared (L2) Entity Cache JPA Metamodel API ...

 
forum_thread

Optimistic Locking

We are having problems with optimistic locking.  I made a simple test case to try to induce an optimistic lock.... I made a simple test case to try to induce an optimistic lock. I have two users logged on to our system.  They both read and ... user 2 and submit. User 2 does not get an optimistic lock exception, so the database has user 2’s change. Do you have a simple ...

 
issue

InternalException during producer/consumer scenario

Hi, I'm trying to use objectdb in a producer/consumer scenario. Producer threads put message objects into a table while consumer threads remove the objects based on age, priority, etc. There are 2 main motivations for using objectdb for this purpose rather than a queue or similar data structure: 1) The consumer can select the "next" object based on a range of potentially complex criteria. 2) The number of objects produced can be potentially exceed available memory so can be held on disk within the objectdb file. Bug Version: 2.2.0 Priority: Normal Status: Fixed Replies: 2 Type:  Bug ...

 
forum_thread

Pessimestic Locking doesn't release when application unexpectedly terminates.

Hi, We have several services in our app framework that we want to use a cluster singleton. Our approach to this was to use Objectdb's pessimestic locking. This seems to work, but if the owner of the current pessimestic lock abruptly quits without releasing the lock it doesn't get released.    Is there anyway the server can detect that a client (lock owner is no longer connected) and therefore release the lock ?   Thank you   Paul Newman ... seems to work, but if the owner of the current pessimestic lock abruptly quits without releasing the lock it doesn't get released.    Is there anyway ...