About flush

forum_thread

Database Inconsistency or corruption

Hi, since a week I have been trying to find a solution to a strange problem. We are using ObjectDB 2.6.8_02 im embedded mode. The problem is that data gets lost when updating an entity. 1-) Background Consider Three entities: ObjectValue, Attribute and Value. ObjectValue has a one to many relationship to Attribute and Attribute has a one to one relationship to Value. ... }       em.flush();       if(em.contains(attr)){ ... }       em.flush();     }     */ ... to commit");     em.flush();         ...

 
issue

com.objectdb.o.InternalException: java.lang.ArrayIndexOutOfBoundsException: null:

The following error appears under and extended persistence context, and with creation, configuration and wiring code that is known to work perfectly with EclipseLink+Glassfish: SEVERE: Unexpected internal exception ... ) { em. flush ( ) ; //ObjectDB ensure id exists. ... ) { if ( DO_PRE_FLUSH ) { em. flush ( ) ; ...

 
forum_thread

Remove not working

Hello! We have a strange problem. ... in the same transaction. No exception is thrown if em.flush() is invoked before em.remove(a); Is it possible that you have a ... deleted. The fix was to do a PersistenceManager.flush() before trying to gather the Extent the second time. I did not ...

 
forum_thread

OrphanRemoval not working?

Dear all, I have entities Invoice and InvoiceItem, their relation is defined: public class Invoice implements Serializable { ..     @OneToMany(mappedBy = "invoice", fetch= FetchType.EAGER, orphanRemoval=true, cascade= CascadeType.ALL)     private List<InvoiceItem> invoiceItemList; .. } ... to null. When saving the entity, I'm using merge and flush. The entity object is managed, so I think this has no effect... ...

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

 
forum_thread

Newbie : How to return the auto-generated ID

Hello, I am new to this community, as well as JPA and ObjectDB. I want to read the auto-generated ID when I persist a new entity (with @Id @GeneratedValue annotations applied). I am following the following link : http://www.objectdb.com/tutorial/jpa/eclipse/web/entity Thanks. ... allocated value is available only after commit or flush and not after persist . If you need to have the id available ...

 
forum_thread

Attempt to remove a detached entity object (error 613)

Hello, that a strange error for me ... I have a detached object in my Java code and i just wanted to merge it ... Unfortunatly, i get this error : Failed to commit transaction: Attempt to remove a detached entity object (error 613)      at com.objectdb.jpa.EMImpl.commit(EMImpl.java:290) We see in this stack trace that is a commit operation, all right ... So why does it try to remove the object ... ? #1 2013-10-11 08:22 Hello, that's a strange error for me ... I have a detached object in my Java code and i just wanted t ...

 
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)