Refresh objects from the database after updating/adding
authorMartin Taal <martin.taal@openbravo.com>
Mon, 24 Jan 2011 14:15:42 +0100
changeset 10093 faf7aa8b8d94
parent 10092 618087ac50e8
child 10094 4d859c79a1ae
Refresh objects from the database after updating/adding
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Mon Jan 24 14:15:21 2011 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Mon Jan 24 14:15:42 2011 +0100
@@ -329,6 +329,11 @@
         }
         OBDal.getInstance().flush();
 
+        // refresh the objects from the db as they can have changed
+        for (BaseOBObject bob : bobs) {
+          OBDal.getInstance().getSession().refresh(bob);
+        }
+
         // almost successfull, now create the response
         // needs to be done before the close of the session
         final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(