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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045764
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2021-01-20 13:472021-01-21 08:30
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in VersionPR21Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0045764: commitAndClose silently rolls back if hibernate trx is marked for roll back

DescriptionWhen 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 Reproduce1. 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 SolutionKeep current behavior (do not throw any exception) but log an error to make it easier to understand the possible problem.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(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
---

- Issue History
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 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 Note Added: 0125696
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
Powered by Mantis Bugtracker