Delete object from collection versus delete from JPQL


I'm a newbie, so this is a pretty fundamental question.

I'm not sure if there is a bi-directional relationship between the objects in memory and ObjectDB.  I know I can modify the objects and use persist() to write them to the database.  But does running a JPQL update or delete alter the in-memory objects?

There are cases where the JPQL syntax is more expressive than operating on a collection, but I'm not sure if that will alter my program state.  Will it?



UPDATE and DELETE queries bypass the EntityManager entity object management, and accordingly break the synchronization between memory and database objects.

See these manual pages for more details:

After using these queries you may use refresh, or discard cached objects in the EntityManager and in the L2 cache. 

ObjectDB Support