details:   https://code.openbravo.com/erp/devel/pi/rev/e884b5f2318b
changeset: 21421:e884b5f2318b
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Wed Nov 06 11:52:46 2013 +0100
summary:   Fixes bug 25075

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
 |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 5359d83f1b88 -r e884b5f2318b 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
    Wed Nov 06 14:28:25 2013 +0530
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
    Wed Nov 06 11:52:46 2013 +0100
@@ -38,6 +38,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.DateUtils;
 import org.apache.log4j.Logger;
+import org.hibernate.LockMode;
 import org.hibernate.Query;
 import org.hibernate.Session;
 import org.hibernate.criterion.Restrictions;
@@ -331,6 +332,7 @@
       if (seq == null && tableName != null) {
         OBCriteria<Sequence> obcSeq = 
OBDal.getInstance().createCriteria(Sequence.class);
         obcSeq.add(Restrictions.eq(Sequence.PROPERTY_NAME, tableName));
+        obcSeq.setLockMode(LockMode.PESSIMISTIC_WRITE);
         if (obcSeq != null && obcSeq.list().size() > 0) {
           seq = obcSeq.list().get(0);
         }

------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to