About flush

forum_thread

Working with a cleared cache

I'm working on trying to improve the performance of our database processing class and I'm attempting to keep the L1 cache within the PersistenceManager cleared in an effort to reduce its memory footprint. The code snippet below is part of a Callable task that is run repeatedly with a given list of commands. When I run the code as written I start getting the stack traces that are listed.  However, if I comment out the calls to makeTransactionalAll() and evictAll() everything works.... ( addCollection ) ;   // Flush the JDO cache m_persistenceManager. evictAll ( ...

 
api-jpa

clear()

Clear the persistence context, causing all managed entities to become detached.(Method of javax.persistence.EntityManager)

 
forum_thread

Query problem after transaction commit

I have a machine running the objectdb server and the client on another machine connect to it. The client program can connect to the server and query to get all the records. However, after transaction.begin ... persist(p) .. commit of a new object, my client program can no longer retrieve the old records but only the latest stored record. I tried to run database explorer on the server machine and able to see all the records including the new stored record.... be a cache issue with a simple solution (e.g. changing flush mode from commit to auto could solve it). However, a situation in which ...

 
api-jdo

deletePersistentAll()

Deletes all the instances of the candidate class that pass the filter.(Method of javax.jdo.Query)

 
api-jpa

persist(entity)

Make an instance managed and persistent.(Method of javax.persistence.EntityManager)

 
api-jdo

javax.jdo.annotations.Unique

Annotation for a database unique constraint.(Annotation of JDO)

 
forum_thread

Access entity version before commit transaction

Hi, I have a usecase where I need to write the updated entity id to the database before commiting the transaction: 1. Change entity field e.g. from a to b 2. Create a change entry in database containing the new version of the entity ... set a String field it doesn´t. I tried transaction.flush() in combination with transaction.refresh(entity) which works but I ... new version, but I get still 1 transaction. flush ( ) ; transaction. refresh ( ...

 
api-jpa

javax.persistence.LockTimeoutException

Thrown by the persistence provider when an pessimistic locking conflict occurs that does not result in transaction rollback.(Exception of JPA)

 
forum_thread

Query for objects persisted within the same transaction

I have a question concerning reading uncommited entities with query, within active transaction. For example, I read data from file. Each line contains value of one of entity's attributes but those values are not unique, so it's possible to have a multiple instances of the same entity. To eliminate duplicates, after reading every line I first check using a query, if an entity with that attribute value already exists. If no - I create one and persist it.... You may change the default flush mode: http://www.objectdb.com/java/jpa/query/setting#Flush_Mode_setFlushMode ObjectDB Support ...

 
api-jpa

javax.persistence.OptimisticLockException

Thrown by the persistence provider when an optimistic locking conflict occurs.(Exception of JPA)