From f43b5fdbf4de852cbcb85039ac1bdba307f7c2dd Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Sun, 14 Feb 2016 18:44:30 +0100 Subject: [PATCH] Fixed bug where new beans where not added to the read cache --- src/zutil/db/bean/DBBean.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/zutil/db/bean/DBBean.java b/src/zutil/db/bean/DBBean.java index 38168de..85726ed 100755 --- a/src/zutil/db/bean/DBBean.java +++ b/src/zutil/db/bean/DBBean.java @@ -218,8 +218,11 @@ public abstract class DBBean { // Execute the SQL DBConnection.exec(stmt); - if( id == null ) - this.id = db.getLastInsertID(stmt); + if( id == null ) { + this.id = db.getLastInsertID(stmt); + // as this is a new object so add it to the cache + DBBeanSQLResultHandler.cacheDBBean(this); + } // Save the list, after we get the object id for(Field field : config.fields){