Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||||||||
View Issue Details | |||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||
0036293 | Openbravo ERP | A. Platform | public | 2017-06-20 11:11 | 2022-02-01 08:08 | ||||||||||||||
Reporter | alostale | ||||||||||||||||||
Assigned To | Triage Platform Base | ||||||||||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||||||||||
Status | acknowledged | Resolution | open | ||||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||||
Product Version | |||||||||||||||||||
Target Version | Fixed in Version | ||||||||||||||||||
Merge Request Status | |||||||||||||||||||
Review Assigned To | |||||||||||||||||||
OBNetwork customer | |||||||||||||||||||
Web browser | |||||||||||||||||||
Modules | Core | ||||||||||||||||||
Support ticket | |||||||||||||||||||
Regression level | |||||||||||||||||||
Regression date | |||||||||||||||||||
Regression introduced in release | |||||||||||||||||||
Regression introduced by commit | |||||||||||||||||||
Triggers an Emergency Pack | No | ||||||||||||||||||
Summary | 0036293: XmlEngine page don't use DAL's connection | ||||||||||||||||||
Description | Documents 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 Reproduce | 1. 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 Solution | It 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. | ||||||||||||||||||
Additional Information | |||||||||||||||||||
Tags | No tags attached. | ||||||||||||||||||
Relationships |
| ||||||||||||||||||
Attached Files | |||||||||||||||||||
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 |
There are no notes attached to this issue. |