Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035137
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2017-02-02 13:202017-03-22 01:01
ReportermaiteView Statuspublic 
Assigned ToAtulOpenbravo 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revisiond6f59afe1b6c
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarkmm82
Web browser
ModulesAdvanced Payables and Receivables Mngmt
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035137: Concurrency problem: current balance wrongly calculated when 2 transactions are processed at same time

DescriptionIn case 2 transactions are processed at same time, current balance field is only updated with second transaction's amount. Problem is that for these 2 transactions same value is returned in financialAccount.getCurrentBalance() as process is not ensuring that transactions are processed in sequential order
Steps To Reproduce1. 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 (line 119) in FIN_TransactionProcess.java:

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

2. Access any Financial Account and check value of "Current Balance" fiel. Go to Transactions tab and create new record setting any GL Item and amount=10. Press "Process" button and execution should be stopped in previous break-point
3. Open "new incognito window" in Chrome and access same Financial Account, go to Transactions tab and create new record setting any GL Item and amount=20. Press "Process" button and execution should be stopped in previous break-point
4. Press "Resume" button (F8) in Eclipse's execution to resume both processes
5. Realize that "Current Balance" field has only been update with +20 amount (instead of +30)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0034021 closedSanjota Concurrency problem: is possible to process same transaction document more than one time when accessing from different sessions 
related to defect 0039672 closedSandrahuguet Improve contention problems in fin_financial_account 
causes defect 0035523 closedAtulOpenbravo It is not possible to process certain transactions from Financial Account 

-  Notes
(0094984)
markmm82 (developer)
2017-03-13 19:47
edited on: 2017-03-13 20:07

Test Plan 1

1. Set the breakpoint in the line setting the current balance: financialAccount.setCurrentBalance(…);
2. Access any Financial Account and check value of "Current Balance" field.
3. Go to Transactions tab and create a new BP Deposit record setting any GL Item and amount=10. Save it.
4. Open "new incognito window" in Chrome and access same Financial Account, go to Transactions tab and create another BP Deposit record setting any GL Item and amount=20.
5. Press "Process" button for transaction created in step 3 and execution should be stopped in previous break-point.
6. Press "Process" button for transaction created in step 4 and execution should be stopped in previous break-point.
7. Press "Resume" button (F8) in Eclipse's execution to resume both processes.
8. Realize that "Current Balance" field has been update with +30 amount (+10 of first transaction and +20 of the second one)

Repeat the test above but creating the transaction document as Bank Fee and BP Withdrawal

(0095004)
markmm82 (developer)
2017-03-14 17:36

Test Plan 2

1. Set the breakpoint in the line setting the current balance: financialAccount.setCurrentBalance(…);
2. Access Caja Financial Account and check value of "Current Balance" field. For instance = 0.
3. Go to Transactions tab and create a new BP Deposit record setting any GL Item and Deposit amount=10. Save it.
4. Open "new incognito window" in Chrome and access same Financial Account, go to Transactions tab and create a Bank Fee record setting any GL Item and withdrawal amount=20.
5. Open "new incognito window" in Chrome and create a new Payment In window:
   Select any BP for F&B España.
   Payment method = Al contado
   Amount = 50
6. Add details to payment:
   Action Regarding Document = Process Received Payment(s) and Deposit
   Overpayment Action = Leave the credit to be used later
   Press done and execution should be stopped in previous break-point.
7. Press "Process" button for transaction created in step 3 and execution should be stopped in previous break-point.
6. Press "Process" button for transaction created in step 4 and execution should be stopped in previous break-point.
7. Press "Resume" button (F8) in Eclipse's execution to resume three processes.
8. Realize that "Current Balance" field has been updated with +40 amount (+10 of first transaction and -20 of the second one and +50 of the payment)
(0095007)
hgbot (developer)
2017-03-15 00:13

Repository: erp/devel/pi
Changeset: 498699b38a5d0ddb368c9be379e25eb2732ee091
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Sat Mar 11 00:46:09 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/498699b38a5d0ddb368c9be379e25eb2732ee091 [^]

Fixes Issue 35137: Concurrency problem: current balance wrongly calculated
when 2 transactions are processed at same time

Lock added at database level for financial account being used while processing
or reactivating transaction.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
---
(0095008)
markmm82 (developer)
2017-03-15 00:15

Code review + Testing OK
(0095050)
markmm82 (developer)
2017-03-15 14:52
edited on: 2017-03-15 15:01

Reopened because failing of some APRM tests and causing a regression

(0095300)
hudsonbot (developer)
2017-03-15 20:22

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test
(0095481)
AtulOpenbravo (developer)
2017-03-21 17:20

Test Plan

- Login as "F&B International Group Admin" role, go to Payment In window.

- Create a new record using the following values:
    Payment Date: Current date
    Received From: Alimentos y Supermercados, S.A.
    Payment Method: Cheque
    Amount: 10.00
    Save that record and click Add Details process.

- In the Add Details popup, click GL Items section to open it and create the following row:
    G/L Item: Capital social
    Received In: 10.00
    Paid Out: 0.00

- At the bottom of the Add Detail popup, fill "Action Regarding Document" field with "Process Received Payment(s)" value. Then click "Done".

- Navigate to "Financial Account" window, select Cuenta de Banco record and go to Transaction Tab.

- Create a new record will the following values:
    Transaction Type: BP Deposit
    Transaction Date: Current date
    Accounting Date: Current date
    Payment: (The just created payment from "Alimentos y Supermercados, S.A.
    business partner)
    Save the record.

- Click "Process" button. Then click Ok in the shown popup to process it.

- Check that It is successfully processed.
(0095482)
hgbot (developer)
2017-03-21 17:26

Repository: erp/devel/pi
Changeset: d6f59afe1b6c08718f8431fb41d5dcf9158bfda8
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Sat Mar 11 00:46:09 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/d6f59afe1b6c08718f8431fb41d5dcf9158bfda8 [^]

Fixes Issue 35137: Concurrency problem: current balance wrongly calculated
when 2 transactions are processed at same time

Lock added at database level for financial account being used while processing
or reactivating transaction.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
---
(0095483)
hgbot (developer)
2017-03-21 17:26

Repository: erp/devel/pi
Changeset: 5df11a52814649fae4c55427332479ed3b1c5ca8
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Mar 21 10:09:56 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/5df11a52814649fae4c55427332479ed3b1c5ca8 [^]

Related to issue 35137: Avoid financial account lazy initialization error

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
---
(0095484)
aferraz (developer)
2017-03-21 17:27

Code review + Testing of second change OK.
(0095495)
hudsonbot (developer)
2017-03-22 01:01

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f76f24f98700 [^]
Maturity status: Test
(0095496)
hudsonbot (developer)
2017-03-22 01:01

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/f76f24f98700 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-02-02 13:20 maite New Issue
2017-02-02 13:20 maite Assigned To => Triage Finance
2017-02-02 13:20 maite Modules => Advanced Payables and Receivables Mngmt
2017-02-02 13:20 maite Triggers an Emergency Pack => No
2017-02-02 13:22 maite Issue Monitored: networkb
2017-02-02 13:32 maite Relationship added related to 0034021
2017-02-02 17:15 markmm82 Assigned To Triage Finance => Sanjota
2017-02-06 12:30 Sanjota Note Added: 0094072
2017-02-06 12:34 Sanjota Note Edited: 0094072 View Revisions
2017-02-06 13:43 Sanjota Status new => scheduled
2017-03-07 18:27 markmm82 Assigned To Sanjota => AtulOpenbravo
2017-03-13 19:42 markmm82 Note Deleted: 0094072
2017-03-13 19:47 markmm82 Note Added: 0094984
2017-03-13 20:07 markmm82 Note Edited: 0094984 View Revisions
2017-03-14 17:36 markmm82 Note Added: 0095004
2017-03-15 00:13 hgbot Checkin
2017-03-15 00:13 hgbot Note Added: 0095007
2017-03-15 00:13 hgbot Status scheduled => resolved
2017-03-15 00:13 hgbot Resolution open => fixed
2017-03-15 00:13 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/498699b38a5d0ddb368c9be379e25eb2732ee091 [^]
2017-03-15 00:15 markmm82 Review Assigned To => markmm82
2017-03-15 00:15 markmm82 Note Added: 0095008
2017-03-15 00:15 markmm82 Status resolved => closed
2017-03-15 00:15 markmm82 Fixed in Version => 3.0PR17Q2
2017-03-15 14:52 markmm82 Note Added: 0095050
2017-03-15 14:52 markmm82 Status closed => new
2017-03-15 14:52 markmm82 Resolution fixed => open
2017-03-15 14:52 markmm82 Fixed in Version 3.0PR17Q2 =>
2017-03-15 15:01 markmm82 Note Edited: 0095050 View Revisions
2017-03-15 16:50 markmm82 Relationship added causes 0035523
2017-03-15 20:22 hudsonbot Checkin
2017-03-15 20:22 hudsonbot Note Added: 0095300
2017-03-21 16:43 AtulOpenbravo Status new => scheduled
2017-03-21 17:20 AtulOpenbravo Note Added: 0095481
2017-03-21 17:26 hgbot Checkin
2017-03-21 17:26 hgbot Note Added: 0095482
2017-03-21 17:26 hgbot Status scheduled => resolved
2017-03-21 17:26 hgbot Resolution open => fixed
2017-03-21 17:26 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/498699b38a5d0ddb368c9be379e25eb2732ee091 [^] => http://code.openbravo.com/erp/devel/pi/rev/d6f59afe1b6c08718f8431fb41d5dcf9158bfda8 [^]
2017-03-21 17:26 hgbot Checkin
2017-03-21 17:26 hgbot Note Added: 0095483
2017-03-21 17:27 aferraz Note Added: 0095484
2017-03-21 17:27 aferraz Status resolved => closed
2017-03-21 17:27 aferraz Fixed in Version => 3.0PR17Q2
2017-03-22 01:01 hudsonbot Checkin
2017-03-22 01:01 hudsonbot Note Added: 0095495
2017-03-22 01:01 hudsonbot Checkin
2017-03-22 01:01 hudsonbot Note Added: 0095496
2018-11-22 09:54 Sandrahuguet Relationship added related to 0039672


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker