Fixed 14012: Do commit immediately after insert into ad_session..
authorStefan Hühner <stefan.huehner@openbravo.com>
Wed, 21 Jul 2010 11:28:33 +0200
changeset 7899 94fcf9a433af
parent 7898 e5ef80a147fb
child 7900 edda5328f260
Fixed 14012: Do commit immediately after insert into ad_session..
.. to prevent a race condition with other requests using i.e. xsql-queries
which otherwise don't see the inserted record early enough.
This happens when using DeepLinking together with any custom AuthManager.
src/org/openbravo/erpCommon/security/SessionLogin.java
--- a/src/org/openbravo/erpCommon/security/SessionLogin.java	Tue Jul 20 18:25:35 2010 +0200
+++ b/src/org/openbravo/erpCommon/security/SessionLogin.java	Wed Jul 21 11:28:33 2010 +0200
@@ -135,7 +135,7 @@
       session.setLoginStatus(status);
       session.setUsername(username);
       OBDal.getInstance().save(session);
-      OBDal.getInstance().flush();
+      OBDal.getInstance().commitAndClose();
       setSessionID(session.getId());
       return 1;
     } catch (Exception e) {