About L2

manual

Shared (L2) Entity Cache

Explains how to set and use the EntityManagerFactory's shared cache (L2 / level 2) in JPA 2.... Page... . This section describes a level 2  (L2) cache of entity objects, which is managed by the EntityManagerFactory ... 's L1 cache and the EntityManagerFactory 's L2 cache, which are managed on the client side - ObjectDB manages also several ...

 
issue

JQL-Update Queries fails with activated L2-Cache

When using JQL-Update Queries it is basically not working without calling entityManager.clear() after a transaction commit. When the clear() method isn't called the entityManager will never return a container the updated Entities. Scenario 1: Disabled L2 Cache, updating elements using UPDATE-Query and fetching Entities afterwards from database. Expected result: Getting changed Entities from database - Actual result: No changes are visble. ... the updated Entities. Scenario 1 : Disabled L2 Cache, updating elements using UPDATE-Query and fetching Entities afterwards ... No changes are visble. Scenario 2 : Disabled L2 Cache, updating elements using UPDATE-Query, calling entityManger.clear() ...

 
forum_thread

In memory processing for ObjectDB

Hi there ! We are building a platform for trades processing where we want to keep our processing speeds very high. We like ObjectDb because its simplicity and the performance benchmarks, but to take it to next level really we wanted to check whether is there any In memory mode available for ObjectDB where recovery is possible, something like prevalyer etc. ... Back end page cache Front end shared L2 data cache Front end object cache Query ...

 
forum_thread

OptimisticLockException

Have read read the documentation on optimistic locks, still not sure how to deal with these exceptions: [ObjectDB 2.2.5_04] javax.persistence.RollbackException Failed to commit transaction: Optimistic lock failed for object   ... You can disable the L2 cache (or empty it with evict ) and empty the EntityManager (L1) ... is globally locked at the database when retrieved from L2 cache ? b) If process B attempts to modify object after it is ...

 
forum_thread

Level 2 cache not hit in @ManyToOne

Hi! I have 2 entities: User and Item, both @Cacheable. Item has @ManyToOne private User user. Level 2 JPA cache is activated and it works ok for find by id (tested by changing data in explorer and reading in my app). Problem 1: find by id on Item it's good, it hits the cache, but not for its field "user". "user" is loaded each time from the DB (tested by changing data in explorer and reading in my app). "user" should also be taken from L2 cache, shouldn't it? Otherwise...it's a huge performance hit. ... and reading in my app). "user" should also be taken from L2 cache, shouldn't it? Otherwise...it's a huge performance hit. ... and 7 be returned fresh (the first time, then loaded from L2 Cache each time)? I didn't encounter P1 and 2 while using ...

 
forum_thread

evictAll() behavior

I'm writing a multi-user drawing tool, using objectdb as the central store.  When a user press F5, I want to pick up all the changes from the database.  So, I call evictAll() in the following ways: pmf.getDataStoreCache().evictAll();  // the factory pm.evictAll();                                 // the persistence manager A couple of questions about this: 1. the first evictAll() seems to be clearing the L2 cache -- is this correct 2. the evicts only work when they are done inside a transaction -- is this specified in the JDO spec?... 1. the first evictAll() seems to be clearing the L2 cache -- is this correct 2. the evicts only work when they are done ... pmf.getDataStoreCache().evictAll() clears the L2 cache. pm.evictAll() clears the persistence manager (L1) cache. ...

 
forum_thread

Is 2 level cache in use?

Hi, Is there any way to check, if 2 level cache is in use? Right now I've done two things: 1. objectdb.conf with cache size is placed in WEB-INF directory of my web application. 2. persistence.xml was modified with: ... You cannot check if the L2 cache is enabled directly but you can check its content , by using ... entity object and then check if it is cached. The L2 cache doesn't always improve performance. It depends on the application. ...

 
forum_thread

IN expression in a Criteria Query

Hello, I am trying to migrate my Spring project from Hibernate to ObjectDB. On ObjectDB page, it is written that ObjectDB is 100% compatible with JPA. However, I have problem with this JPQL query: SELECT e FROM Employee e WHERE e.present = false AND NOT EXISTS (SELECT c FROM Computer c WHERE c.employeeEntity = e) ORDER BY e.name with Hibernate, there was no problem with this query, but ObjectDB throws exception: ... Unexpected query token ':l2' Does anybody have any idea how to solve these problems? ...

 
manual

Advanced JPA Topics

Describes advanced JPA topics - detached entity objects, lock management and entity lifecycle events.... in JPA JPA Lifecycle Events Shared (L2) Entity Cache JPA Metamodel API ...

 
manual

Retrieving JPA Entity Objects

Explains how to use JPA to retrieve entity objects from the database.... data that is retrieved from the database (or from the L2 cache - if enabled). The new entity object is then added to the ...