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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039947
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2019-01-15 08:332022-02-01 08:07
ReporteralostaleView Statuspublic 
Assigned ToTriage Platform Base 
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

0039947: insufficient context logged when DalThreadHandler fails

DescriptionDalThreadHandler is in charge of transparent handling of DAL sessions per request, creating a new DAL session when a request starts and committing and closing it when it finishes.

If there is an exception while committing (ie. during flush), an exception is correctly logged, but because this exception occurs in a very generic piece of code, it does not log any clue of where it has been actually produced.
Steps To Reproduce1. Add the following code to About.java

    OBContext.setAdminMode(true);
    try {
      Invoice i = (Invoice) OBDal.getInstance().createCriteria(Invoice.class).setMaxResults(1)
          .uniqueResult();
      System.out.println(i);
      i.setDescription(i.getDescription() + "-");
      // exit admin mode without flush, so it there is no access to Invoice, DalThreadHandler will
      // fail
    } catch (HibernateException e) {
    }

2. Log in Openbravo and select Employee role
3. Open About popup
    Check log, there is an exception with no info the problem is coming from About.java:

2019-01-15 08:30:17,293 [http-bio-8080-exec-7] ERROR org.openbravo.base.exception.OBSecurityException - Entity Invoice is not writable by this user
org.openbravo.base.exception.OBSecurityException: Entity Invoice is not writable by this user
    at org.openbravo.dal.security.SecurityChecker.checkWriteAccess(SecurityChecker.java:149) [classes/:?]
    at org.openbravo.dal.security.SecurityChecker.checkWriteAccess(SecurityChecker.java:107) [classes/:?]
    at org.openbravo.dal.core.OBInterceptor.doEvent(OBInterceptor.java:349) [classes/:?]
    at org.openbravo.dal.core.OBInterceptor.onFlushDirty(OBInterceptor.java:186) [classes/:?]
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:362) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:332) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:283) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:154) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:235) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:94) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1454) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1440) [hibernate-core-5.3.2.Final.jar:5.3.2.Final]
    at org.openbravo.dal.service.OBDal.flush(OBDal.java:263) [classes/:?]
    at org.openbravo.dal.core.SessionHandler.flushRemainingChanges(SessionHandler.java:693) [classes/:?]
    at org.openbravo.dal.core.SessionHandler.commitAndClose(SessionHandler.java:605) [classes/:?]
    at org.openbravo.dal.core.SessionHandler.commitAndClose(SessionHandler.java:587) [classes/:?]
    at org.openbravo.dal.core.DalThreadHandler.closeDefaultPoolSession(DalThreadHandler.java:69) [classes/:?]
    at org.openbravo.dal.core.DalThreadHandler.doFinal(DalThreadHandler.java:43) [classes/:?]
    at org.openbravo.dal.core.DalRequestFilter$1.doFinal(DalRequestFilter.java:100) [classes/:?]
    at org.openbravo.dal.core.ThreadHandler.run(ThreadHandler.java:66) [classes/:?]
    at org.openbravo.dal.core.DalRequestFilter.doFilter(DalRequestFilter.java:108) [classes/:?]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0036162 acknowledgedTriage Platform Base clean up openbravo.log 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-01-15 08:33 alostale New Issue
2019-01-15 08:33 alostale Assigned To => platform
2019-01-15 08:33 alostale Modules => Core
2019-01-15 08:33 alostale Triggers an Emergency Pack => No
2019-01-15 08:33 alostale Status new => acknowledged
2019-01-15 08:34 alostale Relationship added related to 0036162
2022-02-01 08:07 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker