Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039757Openbravo ERPI. Performancepublic2018-12-04 15:262018-12-12 10:52
Sandrahuguet 
Sandrahuguet 
normalmajorhave not tried
closedfixed 
30Openbravo Appliance 14.04
 
3.0PR18Q3.43.0PR18Q3.4 
alostale
Core
No
0039757: It would be nice to have a method to use lock "FOR NO KEY UPDATE"
It would be nice to have a method to use lock "FOR NO KEY UPDATE", because "FOR UPDATE" in PostgreSQL is too aggressive.
- In order to easily simulate the 2 transactions are processed at same time it is necessary to set a break-point just after execution of following code :

financialAccount.setCurrentBalance(financialAccount.getCurrentBalance().subtract(transaction.getDepositAmount()).add(transaction.getPaymentAmount()));

- Go to Payment In and create a payment:
  Organization: F&B España - Region Norte
  Received From: Alimentos y Supermercados, S.A
  Payment Method: Transferencia
  Deposit To: Cuenta de Banco - EUR
  Amount: 100
  In Add details - > Overpayment Action: Leave the credit to be used later
  Done and execution should be stopped in previous break-point

- Open "new incognito window" in Chrome and access
  Go to Payment In and create a new payment:
  Organization: F&B España - Region Norte
  Received From: Restaurantes Luna Llena, S.A.
  Payment Method: Transferencia
  Deposit To: Cuenta de Banco - EUR
  Amount: 200
  Click in add details, the popup does not open, save the header is locked
No tags attached.
blocks defect 0039755 closed Sandrahuguet It would be nice to have a method to use lock "FOR NO KEY UPDATE" 
Issue History
2018-12-04 15:29SandrahuguetTypedefect => backport
2018-12-04 15:29SandrahuguetTarget Version => 3.0PR18Q3.4
2018-12-05 13:21SandrahuguetReview Assigned To => alostale
2018-12-05 15:22hgbotCheckin
2018-12-05 15:22hgbotNote Added: 0108288
2018-12-05 15:22hgbotStatusscheduled => resolved
2018-12-05 15:22hgbotResolutionopen => fixed
2018-12-05 15:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/8ee19e974b751b598ca333f763fe623c4b6eb96c [^]
2018-12-05 17:50hgbotCheckin
2018-12-05 17:50hgbotNote Added: 0108303
2018-12-05 18:07SandrahuguetNote Added: 0108307
2018-12-05 18:07SandrahuguetStatusresolved => new
2018-12-05 18:07SandrahuguetResolutionfixed => open
2018-12-11 17:51hgbotCheckin
2018-12-11 17:51hgbotNote Added: 0108411
2018-12-11 17:51hgbotCheckin
2018-12-11 17:51hgbotNote Added: 0108412
2018-12-11 17:51hgbotStatusnew => resolved
2018-12-11 17:51hgbotResolutionopen => fixed
2018-12-11 17:51hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/8ee19e974b751b598ca333f763fe623c4b6eb96c [^] => http://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/19193a2a5b15681a29f9f6c35b91903f0b8e6024 [^]
2018-12-12 10:52alostaleNote Added: 0108544
2018-12-12 10:52alostaleStatusresolved => closed
2018-12-12 10:52alostaleFixed in Version => 3.0PR18Q3.4

Notes
(0108288)
hgbot   
2018-12-05 15:22   
Repository: erp/backports/3.0PR18Q3.4
Changeset: 8ee19e974b751b598ca333f763fe623c4b6eb96c
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Wed Dec 05 12:44:44 2018 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/8ee19e974b751b598ca333f763fe623c4b6eb96c [^]

Fixed issue 39757 added in OBDAL lockForNoKeyUpdate

new lockForNoKeyUpdate method to allow the use "FOR NO KEY UPDATE",
because "FOR UPDATE" in PostgreSQL is too aggressive.

---
M src/org/openbravo/dal/service/OBDal.java
---
(0108303)
hgbot   
2018-12-05 17:50   
Repository: erp/backports/3.0PR18Q3.4
Changeset: 850834ffd2286f8383238e66e859608fd57e5c03
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Wed Dec 05 17:17:46 2018 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/850834ffd2286f8383238e66e859608fd57e5c03 [^]

related to issue 39757 code review changes

Not necessary to return the id. Only creates the lock.
Use createNativeQuery and improve code.

---
M src/org/openbravo/dal/service/OBDal.java
---
(0108307)
Sandrahuguet   
2018-12-05 18:07   
author Sandra Huguet <sandra.huguet@openbravo.com>
Wed, 05 Dec 2018 18:04:21 +0100 (2 minutes ago)
changeset 34299 be274de32560
parent 34298 1d4d9b87c8f4
Backed out changeset 850834ffd228

https://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/be274de32560 [^]
(0108411)
hgbot   
2018-12-11 17:51   
Repository: erp/backports/3.0PR18Q3.4
Changeset: 31760ca39b26b98471032f0d1f226e1fa66ae4d8
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Dec 11 17:37:57 2018 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/31760ca39b26b98471032f0d1f226e1fa66ae4d8 [^]

related to issue 39757 backed out changeset 8ee19e974b75

---
M src/org/openbravo/dal/service/OBDal.java
---
(0108412)
hgbot   
2018-12-11 17:51   
Repository: erp/backports/3.0PR18Q3.4
Changeset: 19193a2a5b15681a29f9f6c35b91903f0b8e6024
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Dec 11 17:43:07 2018 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR18Q3.4/rev/19193a2a5b15681a29f9f6c35b91903f0b8e6024 [^]

Fixed issue 39757 change lockForNoKeyUpdate to return the instance with the lock

*Retrieves an object from the database getting a lock "for no key update" for the indicated
object. Change method name, parameters and return.
*Improve and modify the javadoc with the required changes.

---
M src/org/openbravo/dal/service/OBDal.java
---
(0108544)
alostale   
2018-12-12 10:52   
reviewed + tested