Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0029258 | Openbravo ERP | 09. Financial management | public | 2015-03-12 13:51 | 2016-06-24 22:11 | |||||||
Reporter | alostale | |||||||||||
Assigned To | Sandrahuguet | |||||||||||
Priority | normal | Severity | major | Reproducibility | sometimes | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | Fixed in Version | |||||||||||
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. | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ![]() https://issues.openbravo.com/file_download.php?file_id=7887&type=bug ![]() https://issues.openbravo.com/file_download.php?file_id=7888&type=bug | |||||||||||
Issue History | ||||||||||||
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 | bug_revision_view_page.php?rev_id=7942#r7942 | |||||||||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|