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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036293
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformminorhave not tried2017-06-20 11:112022-02-01 08:08
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

0036293: XmlEngine page don't use DAL's connection

DescriptionDocuments generated with XmlEngine use their own ConnectionProvider set in HttpBaseServlet.init. This causes to keep a different connection than DAL's one, so a new connection is borrowed in the same thread whenever it is used.

Steps To Reproduce1. Install DB Pool log module
2. Configure Openbravo.properties to log threads borrowing more than one connection:
     db.pool.logger.enabled=true
     db.pool.logger.logMultipleConnectionsPerThread=true
3. Open any xmlEngine generated page (ie. Login page)
  -> check logs:
d05203b3 1241669 [http-bio-8080-exec-1] DEBUG reloadXml - XmlEngine 29-11-2001 Initialized
d05203b3 1241680 [http-bio-8080-exec-1] WARN org.openbravo.util.db.DBPoolLogger - ***** Trying to get a connection in a thread that already has an active connection.
  org.openbravo.database.ConnectionProviderImpl.getNewConnection(ConnectionProviderImpl.java:260)
  org.openbravo.database.ConnectionProviderImpl.getConnection(ConnectionProviderImpl.java:236)
  org.openbravo.database.ConnectionProviderImpl.getPreparedStatement(ConnectionProviderImpl.java:369)
  org.openbravo.database.ConnectionProviderImpl.getPreparedStatement(ConnectionProviderImpl.java:361)
  org.openbravo.uiTranslation.TextInterfacesData.selectText(TextInterfacesData.java:107)
  org.openbravo.uiTranslation.TranslationUtils.retrieveLabelData(TranslationUtils.java:180)
  org.openbravo.uiTranslation.TranslationUtils.processFormLabels(TranslationUtils.java:33)
  org.openbravo.uiTranslation.TranslationHandler.processTranslations(TranslationHandler.java:216)

d05203b3 1241680 [http-bio-8080-exec-1] WARN org.openbravo.util.db.DBPoolLogger - ** Listing other 1 active connections for this thread in addition to new PooledConnection[org.postgresql.jdbc.PgConnection@54bc2e89] **
d05203b3 1241680 [http-bio-8080-exec-1] WARN org.openbravo.util.db.DBPoolLogger - ===================== ACTIVE - Tue Jun 20 10:48:25 CEST 2017 - 1497948505899 - PooledConnection[org.postgresql.jdbc.PgConnection@1f6a0e8c]
  Thread: http-bio-8080-exec-1
   org.openbravo.dal.core.SessionHandler.getNewConnection(SessionHandler.java:300)
   org.openbravo.dal.core.SessionHandler.createSession(SessionHandler.java:235)
   org.openbravo.dal.core.SessionHandler.begin(SessionHandler.java:561)
   org.openbravo.dal.core.SessionHandler.getSession(SessionHandler.java:183)
   org.openbravo.dal.service.OBQuery.getSession(OBQuery.java:542)
   org.openbravo.dal.service.OBQuery.createQuery(OBQuery.java:242)
   org.openbravo.dal.service.OBQuery.list(OBQuery.java:120)
   org.openbravo.erpCommon.businessUtility.Preferences.getPreferences(Preferences.java:462)
Proposed SolutionIt is not possible to use a DalConnectionProvider in HttpBaseServlet.init because it is not thread safe and it could be used at the same time from different threads.

A thread safe solution would be to create a new DalConnectionProvider in XmlDocument.print method. The problem is current DalConnectionProvider is not accessible from src-core.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0006360 closediperdomo Every once in a while (2 hours) the application gets stuck and you have to stop tomcat and restart 
related to defect 0035855 closedalostale many standard requests borrow more than one connection from DB 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-06-20 11:11 alostale New Issue
2017-06-20 11:11 alostale Assigned To => platform
2017-06-20 11:11 alostale Modules => Core
2017-06-20 11:11 alostale Triggers an Emergency Pack => No
2017-06-20 11:12 alostale Relationship added related to 0006360
2017-06-20 11:13 alostale Relationship added related to 0035855
2017-06-20 11:13 alostale Status new => acknowledged
2022-02-01 08:08 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker