Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0039755 | Openbravo ERP | I. Performance | public | 2018-12-04 15:26 | 2018-12-17 20:39 |
|
Reporter | Sandrahuguet | |
Assigned To | Sandrahuguet | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 0 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR19Q1 | |
Merge Request Status | |
Review Assigned To | alostale |
OBNetwork customer | No |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0039755: It would be nice to have a method to use lock "FOR NO KEY UPDATE" |
Description | It would be nice to have a method to use lock "FOR NO KEY UPDATE", because "FOR UPDATE" in PostgreSQL is too aggressive. |
Steps To Reproduce | - 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 |
Proposed Solution | This is required for PostgreSQL as a workaround until a newer Hibernate version implements HHH-13135 [1].
[1] https://hibernate.atlassian.net/browse/HHH-13135 [^] |
Additional Information | |
Tags | Performance |
Relationships | depends on | backport | 0039756 | 3.0PR18Q4.1 | closed | Sandrahuguet | It would be nice to have a method to use lock "FOR NO KEY UPDATE" | depends on | backport | 0039757 | 3.0PR18Q3.4 | closed | Sandrahuguet | It would be nice to have a method to use lock "FOR NO KEY UPDATE" | blocks | defect | 0039672 | | closed | Sandrahuguet | Improve contention problems in fin_financial_account |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2018-12-04 15:26 | Sandrahuguet | New Issue | |
2018-12-04 15:26 | Sandrahuguet | Assigned To | => Sandrahuguet |
2018-12-04 15:26 | Sandrahuguet | OBNetwork customer | => No |
2018-12-04 15:26 | Sandrahuguet | Modules | => Core |
2018-12-04 15:26 | Sandrahuguet | Triggers an Emergency Pack | => No |
2018-12-04 15:28 | Sandrahuguet | Tag Attached: Performance | |
2018-12-04 15:28 | Sandrahuguet | Relationship added | blocks 0039672 |
2018-12-04 15:29 | Sandrahuguet | Status | new => scheduled |
2018-12-05 13:20 | Sandrahuguet | Review Assigned To | => alostale |
2018-12-05 15:21 | hgbot | Checkin | |
2018-12-05 15:21 | hgbot | Note Added: 0108285 | |
2018-12-05 15:21 | hgbot | Status | scheduled => resolved |
2018-12-05 15:21 | hgbot | Resolution | open => fixed |
2018-12-05 15:21 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/18fd96916ab517067b233cfba9f2f54c70ce3cde [^] |
2018-12-05 17:23 | hgbot | Checkin | |
2018-12-05 17:23 | hgbot | Note Added: 0108298 | |
2018-12-05 17:32 | alostale | Note Added: 0108300 | |
2018-12-05 17:32 | alostale | Status | resolved => closed |
2018-12-05 17:32 | alostale | Fixed in Version | => 3.0PR19Q1 |
2018-12-10 16:15 | Sandrahuguet | Note Added: 0108365 | |
2018-12-10 16:15 | Sandrahuguet | Status | closed => new |
2018-12-10 16:15 | Sandrahuguet | Resolution | fixed => open |
2018-12-10 16:15 | Sandrahuguet | Fixed in Version | 3.0PR19Q1 => |
2018-12-10 16:16 | Sandrahuguet | Note Added: 0108366 | |
2018-12-11 08:12 | hgbot | Checkin | |
2018-12-11 08:12 | hgbot | Note Added: 0108379 | |
2018-12-11 08:12 | hgbot | Status | new => resolved |
2018-12-11 08:12 | hgbot | Resolution | open => fixed |
2018-12-11 08:12 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/devel/pi/rev/18fd96916ab517067b233cfba9f2f54c70ce3cde [^] => http://code.openbravo.com/erp/devel/pi/rev/e893c16b5687c6bd83456b837b55c0e77a9c6b7f [^] |
2018-12-11 13:29 | alostale | Note Added: 0108387 | |
2018-12-11 13:29 | alostale | OS | 30 => |
2018-12-11 13:29 | alostale | OS Version | Openbravo Appliance 14.04 => |
2018-12-11 13:29 | alostale | Proposed Solution updated | |
2018-12-11 13:30 | alostale | Note Deleted: 0108387 | |
2018-12-11 13:30 | alostale | OS | 0 => |
2018-12-11 13:30 | alostale | Proposed Solution updated | |
2018-12-11 15:40 | alostale | Note Added: 0108398 | |
2018-12-11 15:40 | alostale | Status | resolved => closed |
2018-12-11 15:40 | alostale | Fixed in Version | => 3.0PR19Q1 |
2018-12-11 20:22 | hudsonbot | Checkin | |
2018-12-11 20:22 | hudsonbot | Note Added: 0108513 | |
2018-12-11 20:22 | hudsonbot | Checkin | |
2018-12-11 20:22 | hudsonbot | Note Added: 0108515 | |
2018-12-11 20:22 | hudsonbot | Checkin | |
2018-12-11 20:22 | hudsonbot | Note Added: 0108517 | |
2018-12-13 12:12 | hgbot | Checkin | |
2018-12-13 12:12 | hgbot | Note Added: 0108579 | |
2018-12-13 12:35 | hgbot | Checkin | |
2018-12-13 12:35 | hgbot | Note Added: 0108580 | |
2018-12-14 11:44 | hgbot | Checkin | |
2018-12-14 11:44 | hgbot | Note Added: 0108607 | |
2018-12-14 16:04 | hudsonbot | Checkin | |
2018-12-14 16:04 | hudsonbot | Note Added: 0108623 | |
2018-12-14 16:04 | hudsonbot | Checkin | |
2018-12-14 16:04 | hudsonbot | Note Added: 0108624 | |
2018-12-14 16:04 | hudsonbot | Checkin | |
2018-12-14 16:04 | hudsonbot | Note Added: 0108626 | |
2018-12-17 14:38 | hgbot | Checkin | |
2018-12-17 14:38 | hgbot | Note Added: 0108643 | |
2018-12-17 20:39 | hudsonbot | Checkin | |
2018-12-17 20:39 | hudsonbot | Note Added: 0108657 | |
Notes |
|
(0108285)
|
hgbot
|
2018-12-05 15:21
|
|
Repository: erp/devel/pi
Changeset: 18fd96916ab517067b233cfba9f2f54c70ce3cde
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Dec 04 15:42:37 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/18fd96916ab517067b233cfba9f2f54c70ce3cde [^]
Fixed issue 39755 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
---
|
|
|
(0108298)
|
hgbot
|
2018-12-05 17:23
|
|
Repository: erp/devel/pi
Changeset: 1c1d34a46d47bd88ecdaeeda7e84e00d9c313ec0
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Wed Dec 05 17:17:46 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1c1d34a46d47bd88ecdaeeda7e84e00d9c313ec0 [^]
related to issue 39755 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
---
|
|
|
|
core reviewed + tested in Oracle and PostgreSQL. In both cases:
* Lock is correctly acquired (concurrent threads wait the one with the lock to release it in order to continue).
* Acquiring a record doesn't prevent insertions in other entities with a FK to that record (locking BP an creating an Order for that BP is now possible in PG) |
|
|
|
reopen in order to improve lockForNoKeyUpdate method |
|
|
|
|
|
(0108379)
|
hgbot
|
2018-12-11 08:12
|
|
Repository: erp/devel/pi
Changeset: e893c16b5687c6bd83456b837b55c0e77a9c6b7f
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Mon Dec 10 16:26:15 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e893c16b5687c6bd83456b837b55c0e77a9c6b7f [^]
fixed issue 39755 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
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(0108579)
|
hgbot
|
2018-12-13 12:12
|
|
Repository: erp/devel/pi
Changeset: 2df0dc2f8b0834aeeb5cc605e424c72c7263bb93
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Dec 13 12:07:51 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2df0dc2f8b0834aeeb5cc605e424c72c7263bb93 [^]
related with issue 39755: prevent time based thread syncrhonization in tests
Time based synchronization is error-prone and can cause false positives.
Synchronizing events now with CountDownLatch.
---
M src-test/src/org/openbravo/test/dal/DalLockingTest.java
---
|
|
|
(0108580)
|
hgbot
|
2018-12-13 12:35
|
|
|
|
(0108607)
|
hgbot
|
2018-12-14 11:44
|
|
Repository: erp/devel/pi
Changeset: 2da162a5e21339af4a8662733fc9a45744d997a5
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Dec 14 11:43:52 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2da162a5e21339af4a8662733fc9a45744d997a5 [^]
related with issue 39755: preventing false test positives
T1 and T2 could finish exactly at the same time, now the chances are reduced
by adding a short delay to T2 after finalization. Also synchronizing on exectionOrder
---
M src-test/src/org/openbravo/test/dal/DalLockingTest.java
---
|
|
|
|
|
|
|
|
|
|
|
|
(0108643)
|
hgbot
|
2018-12-17 14:38
|
|
|
|
|
|