Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0045764 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] A. Platform | major | have not tried | 2021-01-20 13:47 | 2021-01-21 08:30 | |||
Reporter | alostale | View Status | public | |||||
Assigned To | alostale | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | PR21Q2 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
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 | approved | |||||||
Review Assigned To | ||||||||
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 | 0045764: commitAndClose silently rolls back if hibernate trx is marked for roll back | |||||||
Description | When the hibernate transaction is marked for rollback and OBDal.commitAndClose is invoked, the database transaction is silently rolled back instead of committed. Hibernate transaction is marked for rollback in case flush throws an exception. | |||||||
Steps To Reproduce | 1. Write an event observer that throws an exception. Here an example [1] 2. Do a DAL modification and a flush to trigger that exception. Here an example [2] 3. Catch the exception, do a valid modification reverting previous one and do commitAndClose -> The code will apparently work but in DB it will be rolled back (ROLLBACK statement can also be seen in postrgresql log) [1] https://gitlab.com/alo-issues/demo/org.alo.issue.importentry/-/blob/master/src/org/alo/issue/importentry/FailUpdateProductHandler.java [^] [2] https://gitlab.com/alo-issues/demo/org.alo.issue.importentry/-/snippets/2063676 [^] | |||||||
Proposed Solution | Keep current behavior (do not throw any exception) but log an error to make it easier to understand the possible problem. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
|
![]() |
|
(0125696) hgbot (developer) 2021-01-20 14:00 |
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/268 [^] |
(0125703) hgbot (developer) 2021-01-21 08:30 |
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/268 [^] |
(0125704) hgbot (developer) 2021-01-21 08:30 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/openbravo [^] Changeset: 68bac62a2d7c8c3c38746b2960a96cd826d136a1 Author: Asier Lostalé <asier.lostale@openbravo.com> Date: 2021-01-20T13:55:45+01:00 URL: https://gitlab.com/openbravo/product/openbravo/-/commit/68bac62a2d7c8c3c38746b2960a96cd826d136a1 [^] fixed BUG-45764: commit silently rolls back if trx is marked for rollback When commitAndClose is invoked on a Hibernate transaction that is marked for rollback, database connection is rolledback without any information. Now this situtation adds logs with stack trace to make it easier to debug. --- M src/org/openbravo/dal/core/SessionHandler.java --- |
![]() |
|||
Date Modified | Username | Field | Change |
2021-01-20 13:47 | alostale | New Issue | |
2021-01-20 13:47 | alostale | Assigned To | => platform |
2021-01-20 13:47 | alostale | OBNetwork customer | => No |
2021-01-20 13:47 | alostale | Modules | => Core |
2021-01-20 13:47 | alostale | Triggers an Emergency Pack | => No |
2021-01-20 13:47 | alostale | Assigned To | platform => alostale |
2021-01-20 13:48 | alostale | Summary | commitAndClose silently rolled back if hibernate trx is marked to roll back => commitAndClose silently rolled back if hibernate trx is marked for roll back |
2021-01-20 13:48 | alostale | Summary | commitAndClose silently rolled back if hibernate trx is marked for roll back => commitAndClose silently rolls back if hibernate trx is marked for roll back |
2021-01-20 14:00 | hgbot | Merge Request Status | => open |
2021-01-20 14:00 | hgbot | Note Added: 0125696 | |
2021-01-21 08:29 | hgbot | Merge Request Status | open => approved |
2021-01-21 08:30 | hgbot | Resolution | open => fixed |
2021-01-21 08:30 | hgbot | Status | new => closed |
2021-01-21 08:30 | hgbot | Fixed in Version | => PR21Q2 |
2021-01-21 08:30 | hgbot | Note Added: 0125703 | |
2021-01-21 08:30 | hgbot | Note Added: 0125704 |
Copyright © 2000 - 2009 MantisBT Group |