Fast Object Database for Java - with JPA/JDO support

Internal Website Search

1-10 of 56 resultsRefresh
161

Locking in JPA

JPA 2 supports both optimistic locking and pessimistic locking. Locking is essential to avoid ... to pessimistic locking it is easier to use and more efficient. In the rare cases in which update collision must be revealed earlier (before transaction commit) pessimistic locking can be used. When using
88

LockModeType.PESSIMISTIC_WRITE

Enum Constant javax.persistence.LockModeType PESSIMISTIC_WRITE Pessimistic write lock. Since: JPA 2.0
88

LockModeType.PESSIMISTIC_READ

Enum Constant javax.persistence.LockModeType PESSIMISTIC_READ Pessimistic read lock. Since: JPA 2.0
88

LockModeType.PESSIMISTIC_FORCE_INCREMENT

Enum Constant javax.persistence.LockModeType PESSIMISTIC_FORCE_INCREMENT Pessimistic write lock, with version update. Since: JPA 2.0
43

Setting and Tuning of JPA Queries

. JPA 2 adds support for pessimistic locking. The setLockMode method sets a lock mode ... execution sets a pessimistic WRITE lock on all the result objects:   List results = query.setLockMode(LockModeType.PESSIMISTIC_WRITE) .getResultList(); Notice that when a query
32

Pessimistic Lock Timeouts setting

) - and my test case is failing here. The issue is that once the pessimistic lock is in place on the record ... William Support of pessimistic lock timeout setting (javax.persistence.lock.timeout) was just added in ... have to stress, that the pessimistically locked entity has a transaction propagation of REQUIRES_NEW
31

Advanced JPA Topics

Describes advanced JPA topics - detached entity objects, lock management and entity lifecycle events.
31

ObjectDB Object Database Features

(can be injected to a @Version field). Optimistic locking (always active). Implicit pessimistic locking (JDO). Explicit pessimistic locking (JPA 2). Always Object Level locking. Lock modes: READ/WRITE, OPTIMISTIC/PESSIMISTIC. Database Tools and Utilities ObjectDB provides the following database tools
30

EntityTransaction.commit() does not release a pessimistic lock

It appears that EntityTransaction.commit() does not release a pessimistic lock -> test code ... (); Account a1 = em1.find(Account.class, 0, LockModeType.PESSIMISTIC_WRITE); a1.credit(10); em1.getTransaction().commit(); System.out.println(em1.getLockMode(a1)); // -> PESSIMISTIC_WRITE
29

Pessimistic lock timeout - blocks indefinitely

I've attached a simple test which creates an object then kicks off several threads which each try to update the object. I'm using a pessimistic lock with timeout as follows: MapPESSIMISTIC_WRITE, properties

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support