Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0029258 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 09. Financial management | major | sometimes | 2015-03-12 13:51 | 2016-06-24 22:11 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | Sandrahuguet | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | 1c18bcb8922b | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | ||||||||
Review Assigned To | eduardo_Argal | |||||||
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 | 0029258: FIN_Utility.getDocumentNo method can return duplicates | |||||||
Description | FIN_Utility.getDocumentNo method can return duplicates. It is the same problem reported in 0025075. This fix [1] seems to have two problems: 1. It tries to acquire a lock in ad_sequence only in case docType.getDocumentSequence() is null. If it is not null, no lock is acquired being possible to get duplicates. 2. The lock when docType.getDocumentSequence() is null seems not to be done in database. Testing it it PG a select statement without "for update" clause is sent to DB. This, most probably, occurs due to a hibernate issue [2] [1] https://code.openbravo.com/erp/devel/pi/rev/e884b5f2318b77d3cbd8765541d5a5b4b5ebbef2 [^] [2] https://hibernate.atlassian.net/browse/HHH-5275 [^] | |||||||
Steps To Reproduce | It is hard to reproduce in a real environment as concurrency in very specific conditions is required: -Thread A starts transaction -Thread A gets document number for a concrete document type -Thread B starts transaction -Thread B gets document number for the same document type A got it --> B got the same number than A Attached DocumentNumberGeneration class with test cases emulating these conditions. It fails for the cases: -twoDalCalls -dalFirstThenPL -plFirstThenDal | |||||||
Proposed Solution | -Is it required to have different implementations one in PL and another one in DAL? -If both are required fix DAL: * Change current lock to prevent hibernate issue * Add lock for second case which currently is unattended Attached export with proposed solution, pending to review with functional team. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() ![]() | |||||||
![]() |
||||||||
|
![]() |
|
(0087895) hgbot (developer) 2016-06-24 13:10 |
Repository: erp/devel/pi Changeset: 1c18bcb8922b1ed9cee90c9867ab5d9dfdb10358 Author: David Miguelez <david.miguelez <at> openbravo.com> Date: Fri Jun 24 13:09:36 2016 +0200 URL: http://code.openbravo.com/erp/devel/pi/rev/1c18bcb8922b1ed9cee90c9867ab5d9dfdb10358 [^] Fixes Issue 29258. Fixes problem when locking a sequence number to avoid duplicates. Now it locks the sequence number using LockOptions.UPGRADE instead. --- M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java A src-test/src/org/openbravo/advpaymentmngt/test/DocumentNumberGeneration.java --- |
(0087896) eduardo_Argal (viewer) 2016-06-24 13:12 |
Reviewed and tested |
(0087913) hudsonbot (viewer) 2016-06-24 22:11 |
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/cc0900cf80c9 [^] Maturity status: Test |
![]() |
|||
Date Modified | Username | Field | Change |
2015-03-12 13:51 | alostale | New Issue | |
2015-03-12 13:51 | alostale | Assigned To | => Sandrahuguet |
2015-03-12 13:51 | alostale | OBNetwork customer | => No |
2015-03-12 13:51 | alostale | Modules | => Core |
2015-03-12 13:51 | alostale | Triggers an Emergency Pack | => No |
2015-03-12 13:52 | alostale | File Added: DocumentNumberGeneration.java | |
2015-03-12 13:57 | alostale | Steps to Reproduce Updated | View Revisions |
2015-03-12 13:58 | alostale | Relationship added | related to 0025075 |
2015-03-12 14:00 | alostale | Proposed Solution updated | |
2015-03-12 15:19 | alostale | Proposed Solution updated | |
2015-03-12 15:20 | alostale | File Added: issue-29258.export | |
2016-01-19 05:00 | yogaskarnik | Issue Monitored: yogaskarnik | |
2016-06-24 13:10 | hgbot | Checkin | |
2016-06-24 13:10 | hgbot | Note Added: 0087895 | |
2016-06-24 13:10 | hgbot | Status | new => resolved |
2016-06-24 13:10 | hgbot | Resolution | open => fixed |
2016-06-24 13:10 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/1c18bcb8922b1ed9cee90c9867ab5d9dfdb10358 [^] |
2016-06-24 13:12 | eduardo_Argal | Review Assigned To | => eduardo_Argal |
2016-06-24 13:12 | eduardo_Argal | Note Added: 0087896 | |
2016-06-24 13:12 | eduardo_Argal | Status | resolved => closed |
2016-06-24 22:11 | hudsonbot | Checkin | |
2016-06-24 22:11 | hudsonbot | Note Added: 0087913 |
Copyright © 2000 - 2009 MantisBT Group |