About detach

101-110 of 160Refresh
Forum
2

Cascading makeTransient

adds an option to treat embedded objects on detachment (eventually it may be better ... before using ObjectDB:     System.setProperty("objectdb.temp.detach-embeddable", "true"); Then embedded objects are expected to be disconnected when owner entity objects are detached (made transient
Forum
2

List of Enum Values in an entity

this tutorial on detached Guest instances, and in detached objects only fields that have been loaded before detachment (e.g. defined as eager rather than lazy, or accessed) are available. One way to solve
Forum
2

Puzzler: Not getting cascades on read from Spring context

Fetching doesn't work by default for detached objects. Please read see this issue and as a workaround you may try setting objectdb.temp.no-detach. Would it make sense to call entityManager.merge(o ... , if possible, to arrange fetching of the relevant data before detachment. dhosek
Forum
2

UserException - Object User#2 belongs to another EntityManager

.JpaQuery.getResultList(JpaQuery.java:686) ... 107 more The problem can be fixed by detaching User ... for running the query). When an EntityManager is closed all its objects should be detached automatically ... as soon as possible. Accordingly, detaching the object before using it as a query parameter
Forum
1

"Attempt to lock a non entity object" error

persistence context and detach all managed entity objects: ... Rolling back a transaction - either by ... and would prefer.  It is correct. All the entity objects are detached on rollback. This is how it should work
Forum
1

Can't get arraylist/vector type attributes

entity objects become detached, and content that has not been retrieved from the datbase ... the EntityManager or load it eagerly (FetchType.EAGER). See also "objectdb.temp.no-detach" as a possible quick workaround. Loading it eagerly worked
Forum
1

Different behavior with persist() and queried instances?

the entity manager so my object gets detached. Between the persist() and the commit() call, my list ... .ArrayList). However, after detaching it becomes a regular java.util.Array again which of course
Forum
1

Dirty checking

, the JPA state diagram seems to indicate that post commit entities are automatically set to 'Detached ... , they won't be retrieved for the detached object. I'm not sure how ObjectDb handles that, am guessing
Forum
1

Entity listener - event instead of object

). You may create a copy of that object (maybe by JPA's detach + merge or by JDO's detachCopy). Then you may be able to compare on @PostUpdate the entity object after the update with the cloned detached entity object before the update. lwalkowski
Forum
1

Error during cascaded merge

");     List result = query.getResultList();     Unit unit = result.get(0);     em.detach ... ); } This is exactly what happens in our webapp. A unit entity gets detached, the user edits