You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@TestpublicvoidtestLazyLoad(){
DB.script().run("/test-setup.sql");
// Please execute the script in [test.sql] every time you execute the test to reset the dataConfigc1 = newQConfig().setUseCache(true).setId("config_1").findOne();
List<ConfCp> confCpList = c1.getConfCpList();
if(confCpList != null && !confCpList.isEmpty()){
List<ConfCpCon> conList = confCpList.get(0).getConList();
if (!conList.isEmpty()) {
conList.get(0);
}
}
c1.setConfigName("c1");
Configc2 = newQConfig().setUseCache(true).setId("config_1").findOne();
ConfCpconfCp = c2.getConfCpList().get(0);
ConfCpConcon = newConfCpCon();
con.setId("newCon");
con.setEnabled("N");
confCp.getConList().clear();
confCp.getConList().add(con);
c2.getConfCpList().clear();
c2.getConfCpList().add(confCp);
//DB.markAsDirty(c2);c2.save();
c1.save(); // THIS UPDATE HERE ... will also push L2 cache update of ManyIds which have changed by c2.save()Configconfig = newQConfig().setUseCache(true).setId("config_1").findOne();
List<ConfCp> confCpList1 = config.getConfCpList();
if(confCpList1 != null && !confCpList1.isEmpty()){
List<ConfCpCon> conList = confCpList1.get(0).getConList();
if (conList != null) {
for (ConfCpConconfCpCon : conList) {
System.out.println("---- id: "+confCpCon.getId());
// An exception will be thrown here// EntityNotFoundException: Bean not found during lazy load or refreshSystem.out.println(confCpCon.getId()+":"+confCpCon.getEnabled());
}
}
}
}
The issue can be seen in the logs as the last 2 PUT calls here should not really be made as the collection hasn't actually been mutated in terms of additions or removals.
Steps to reproduce
The issue can be seen in the logs as the last 2
PUT
calls here should not really be made as the collection hasn't actually been mutated in terms of additions or removals.The text was updated successfully, but these errors were encountered: