mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-03 08:24:23 +00:00
#722 - NotifyOfCommit failed. L2 Cache potentially not notified. - NullPointerException at BeanDescriptorCacheHelp.java:299
This commit is contained in:
1 parent
46e674db57
commit
676f0d7a24
3 files changed
+44
-3
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.avaje.tests.cache;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
@@ -240,4 +241,37 @@ public class TestCacheCollectionIds extends BaseTestCase {
|
||||
Assert.assertEquals(1, result.getCountries().size());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdating_noChange() throws InterruptedException {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
Ebean.beginTransaction();
|
||||
try {
|
||||
|
||||
OCachedBean cachedBean = new OCachedBean();
|
||||
cachedBean.setName("helloForUpdate");
|
||||
Ebean.save(cachedBean);
|
||||
|
||||
cachedBean = Ebean.find(OCachedBean.class, cachedBean.getId());
|
||||
|
||||
cachedBean.setName("mod");
|
||||
ArrayList<Country> list = new ArrayList<Country>();
|
||||
list.add(Ebean.find(Country.class, "NZ"));
|
||||
cachedBean.setCountries(list);
|
||||
Ebean.save(cachedBean);
|
||||
|
||||
|
||||
cachedBean.setName("mod2");
|
||||
Ebean.save(cachedBean);
|
||||
|
||||
Ebean.commitTransaction();
|
||||
} finally {
|
||||
Ebean.endTransaction();
|
||||
}
|
||||
|
||||
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class OCachedBean {
|
||||
|
||||
String name;
|
||||
|
||||
@ManyToMany
|
||||
@ManyToMany(cascade = CascadeType.ALL)
|
||||
List<Country> countries = new ArrayList<Country>();
|
||||
|
||||
@OneToMany(mappedBy = "cachedBean", cascade = CascadeType.ALL)
|
||||
|
||||
Reference in new issue
Block a user