details:   /erp/devel/pi/rev/dfcbfe6138cc
changeset: 10090:dfcbfe6138cc
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Jan 24 14:13:25 2011 +0100
summary:   Made flush controllable when getting connection

details:   /erp/devel/pi/rev/8eaee0bdefcd
changeset: 10091:8eaee0bdefcd
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Mon Jan 24 14:13:58 2011 +0100
summary:   Added windowid to standard request parameters

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
 |   1 +
 src/org/openbravo/dal/service/OBDal.java                                       
                  |  23 ++++++++-
 src/org/openbravo/service/db/DalConnectionProvider.java                        
                  |   4 +-
 3 files changed, 22 insertions(+), 6 deletions(-)

diffs (72 lines):

diff -r 6ceba33c2320 -r 8eaee0bdefcd 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
  Mon Jan 24 13:58:00 2011 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-utilities.js
  Mon Jan 24 14:13:58 2011 +0100
@@ -825,6 +825,7 @@
   if (theView && theView.tabId) {
     var tabParam = {
       params: {
+        windowId: theView.standardWindow.windowId,
         tabId: theView.tabId,
         moduleId: theView.moduleId
       }
diff -r 6ceba33c2320 -r 8eaee0bdefcd src/org/openbravo/dal/service/OBDal.java
--- a/src/org/openbravo/dal/service/OBDal.java  Mon Jan 24 13:58:00 2011 +0100
+++ b/src/org/openbravo/dal/service/OBDal.java  Mon Jan 24 14:13:58 2011 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2011 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -81,9 +81,24 @@
    * @see #flush()
    */
   public Connection getConnection() {
-    // before returning a connection always flush all other hibernate actions
-    // to the database.
-    flush();
+    return getConnection(true);
+  }
+
+  /**
+   * Returns the connection used by the hibernate session.
+   * 
+   * @param doFlush
+   *          if true then the current actions are first flushed.
+   * 
+   * @return the current database connection
+   * @see #flush()
+   */
+  public Connection getConnection(boolean doFlush) {
+    if (doFlush) {
+      // before returning a connection flush all other hibernate actions
+      // to the database.
+      flush();
+    }
 
     // NOTE: workaround for this issue:
     // http://opensource.atlassian.com/projects/hibernate/browse/HHH-3529
diff -r 6ceba33c2320 -r 8eaee0bdefcd 
src/org/openbravo/service/db/DalConnectionProvider.java
--- a/src/org/openbravo/service/db/DalConnectionProvider.java   Mon Jan 24 
13:58:00 2011 +0100
+++ b/src/org/openbravo/service/db/DalConnectionProvider.java   Mon Jan 24 
14:13:58 2011 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2009 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2011 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -75,7 +75,7 @@
 
   public Connection getConnection() throws NoConnectionAvailableException {
     if (connection == null) {
-      connection = OBDal.getInstance().getConnection();
+      connection = OBDal.getInstance().getConnection(flush);
     }
 
     // always flush all remaining actions

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to