About flush

release

2.2.1

... Fixed a bug in queries on deleted objects before commit / flush. Version 2.2.0 Added full support of JPA 2 ...

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

 
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

Problem with @Basic(fetch = FetchType.LAZY)

I have a class where two fields are annotated with @Basic(fetch = FetchType.LAZY) due to them containing quite long Strings and me loading ALL entities of the database on application startup (swing app) This class should hopefully demonstrate the problem: ... ) . commit ( ) ; em. flush ( ) ; em. close ( ) ; ...

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

 
api-jpa

javax.persistence.OrderColumn

Specifies a column that is used to maintain the persistent order of a list.(Annotation of JPA)

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

 
api-jpa

javax.persistence.PessimisticLockException

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

 
forum_thread

On initialisation of lists: impact on migration from EclipseLink to ObjectDB

I would like to draw the attention of those assessing migration from EclipseLink ORM to ObjectDB to a significant difference in the initialization of persistent lists, namely that EclipseLink injects a List implementation into the List field to be initialise it during EntityManager.persist(). So in EclipseLink the following works: public class HasListOfBlocks { .. ... ; em. persist ( h ) ; em. flush ( h ) ; //optional Block childBlock = new ...

 
forum_thread

Need help to make this test work and define proper annotations for entities Lists

Hi, I can't get this simple test case to work, i know it is probably due to the lack of proper annotations on entities list, could anyone help me to define them? NB in this test case I didn't set all entities methods for the sake of clarity, also in actual application no field are public nor static and no entity is static.    ... ) . commit ( ) ; em. flush ( ) ; em. close ( ) ; ...