mirror of https://github.com/apache/openjpa.git
OPENJPA-2136: Fix NPE when using LiteAutoDetach.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1292034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c55f8469f1
commit
6599b7b403
openjpa-kernel/src/main/java/org/apache/openjpa/kernel
openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/detachment
|
@ -3457,6 +3457,9 @@ public class BrokerImpl
|
|||
if (_transAdditions != null) {
|
||||
_transAdditions.clear();
|
||||
}
|
||||
if (_pending != null) {
|
||||
_pending = null;
|
||||
}
|
||||
if (_dmLite == null) {
|
||||
_dmLite = new DetachManagerLite(_conf);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,16 @@ public class TestDetachLite extends TestDetach {
|
|||
root = createData();
|
||||
}
|
||||
|
||||
public void testPendingClear() {
|
||||
EntityManager em = emf.createEntityManager();
|
||||
DMCustomer dm = em.find(DMCustomer.class, root.getId());
|
||||
dm.setLastName(System.currentTimeMillis() + "--last");
|
||||
em.clear();
|
||||
em.getTransaction().begin();
|
||||
// Pre OPENJPA-2136 this commit call would fail.
|
||||
em.getTransaction().commit();
|
||||
}
|
||||
|
||||
public void testLeaveProxy() {
|
||||
Object[] p = props;
|
||||
p[1] = "loaded(LiteAutoDetach=true,DetachProxyFields=false)";
|
||||
|
|
Loading…
Reference in New Issue