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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0047750
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajorhave not tried2021-09-23 12:422021-10-18 14:45
ReportercbernerView Statuspublic 
Assigned Toplatform 
PrioritynormalResolutionopenFixed in Version
StatusacknowledgedFix 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

0047750: Warning attempts to update an immutable entity M_Transaction when running hibernate with warn log

DescriptionIf running Openbravo with hibernate log level set to warning(we currently have it on error only) it will show up a warning related with updating an immutable entity. Check the provided warning from log.

Warning from log:
2021-08-20 11:39:05,353 [DefaultQuartzScheduler_Worker-1] WARN org.hibernate.internal.SessionImpl - HHH000487: The query: [ update MaterialMgmtMaterialTransaction as trx set trx.isProcessed = false where trx.isProcessed = true and trx.isCostCalculated = false and trx.costingStatus <> 'S' and trx.organization.id in (:orgs_0, :orgs_1, :orgs_2, :orgs_3, :orgs_4, :orgs_5, :orgs_6, :orgs_7, :orgs_8, :orgs_9, :orgs_10, :orgs_11)] attempts to update an immutable entity: [M_Transaction]
Steps To Reproduce1. Modify log4j2-web.xml and set this property to warn, which previously was error:
<Logger name="org.hibernate" level="warn"/>
2. Run tomcat and check logs after a minute or so. That warning should appear in the log.

Alternatively:
1. Modify log4j2-web.xml and set this property to warn, which previously was error:
<Logger name="org.hibernate" level="warn"/>
2. Open backoffice and login.
3. Go to Process Request
4. Add a new row with process "Costing Background process" and Timing: "Run immediatly"
5. Save it and schedule it, you should be able to see the logged warning.
Proposed SolutionThis is already reported to hibernate, we're waiting for a response on the status of the issue: https://hibernate.atlassian.net/browse/HHH-13860 [^] [^]

However, we do have a workaround for this issue in particular, instead of doing a mass update query through hibernate, we could as a solution, use sqlc like in the same CostingBackground file in InitializeCostingMTransCostDateacctData.initializeCostingMTransCostDateacct(cp.getConnection(), cp); line
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0045969 newplatform upgrade to Hibernate 6.x (prototype) 
blocks design defect 0047873 acknowledgedplatform Set hibernate logging to warn or info level, instead of error only 

-  Notes
(0132272)
cberner (developer)
2021-10-08 12:30

This warning seems to be due to how we handle computed columns. We have 2 hibernate mapping classes when we define computed columns. For example: Order and Order_ComputedColumns, first one is mutable and the second one is read-only immutable. It seems that using Hibernate update hql queries through session.createQuery API results in the warning, because it checks both the first class, and also the class of the computed columns, although we don't modify any property on that second class.

This is already reported to hibernate, we're waiting for a response on the status of the issue: https://hibernate.atlassian.net/browse/HHH-13860 [^]

However, we do have a workaround for this issue in particular, instead of doing a mass update query through hibernate, we could as a solution, use sqlc like in the same CostingBackground file in InitializeCostingMTransCostDateacctData.initializeCostingMTransCostDateacct(cp.getConnection(), cp); line
(0132414)
cberner (developer)
2021-10-18 14:32

After talking with vmromanos, they'll probably remove the CostingBackground process in the near future, as such, we're marking this issue as aknowledged, waiting for 2 things:

1. Removal of CostingBackground process, and recheck that the warning doesn't exist anymore.
2. Fix from hibernate to this warning, when done update and recheck for this warning.

Whatever happens first, this issue should be rechecked.

- Issue History
Date Modified Username Field Change
2021-09-23 12:42 cberner New Issue
2021-09-23 12:42 cberner Assigned To => platform
2021-09-23 12:42 cberner Modules => Core
2021-09-23 12:42 cberner Triggers an Emergency Pack => No
2021-09-23 15:27 shuehner Issue Monitored: shuehner
2021-10-05 14:42 cberner Severity minor => major
2021-10-08 12:30 cberner Note Added: 0132272
2021-10-13 14:26 cberner Steps to Reproduce Updated View Revisions
2021-10-13 14:26 cberner Proposed Solution updated
2021-10-18 14:32 cberner Note Added: 0132414
2021-10-18 14:32 cberner Status new => acknowledged
2021-10-18 14:45 cberner Type defect => design defect
2021-10-18 14:45 cberner Relationship added related to 0045969
2021-10-18 14:59 cberner Relationship added blocks 0047873


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker