|Re: [eclipselink-users] synchronization of new object question|
Hello Leon,This is a feature of using FlushModeType.AUTO (the default). When executing a query, it will attempt to flush the EntityManager, ensuring that any changes made are all ready in the database before the query gets executed. You can change the FlushModeType on a per query basis or on the EntityManager by using the setFlushMode(FlushModeType.COMMIT) which will force the changes into the database only on commit.
Best Regards, Chris Leon Derks wrote:
I get the error message below when I run the following:getEntityManager().createNamedQuery("findImageInfoByExample").setParameter("visualElementId", visualElementId).getSingleResult();My question is, why is the entitymanager synchronizing during this query? I would expect to synchronize only during entityManager.persist() or merge().I don't want to persist the new , but want to check if the same is already stored in the db.Is it possible to disable the synchronisation? Error:During synchronization a new object was found through a relationship that was not marked cascade PERSIST: ****.model.ImageInfo_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users
Back to the top