Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036299Openbravo ERPA. Platformpublic2017-06-20 14:482017-06-26 19:40
alostale 
alostale 
normalminorhave not tried
closedfixed 
5
 
3.0PR17Q3 
caristu
Core
No
0036299: many requests for standard 2.50 buttons borrow 2 connections
When a 2.50 style process is opened some requests are performed each of them borrowing 2 connections due to XmlEngine translation (see 0036293).

1. Install DB Pool log module [1]
2. Configure Openbravo.properties to log threads borrowing more than one connection:
     db.pool.logger.enabled=true
     db.pool.logger.logMultipleConnectionsPerThread=true
3. Select a Sales Order
4. Click on Book button
  -> check log (among others):

d05203b3 7495224 [http-bio-8080-exec-4] 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 7495224 [http-bio-8080-exec-4] WARN org.openbravo.util.db.DBPoolLogger - ** Listing other 1 active connections for this thread in addition to new PooledConnection[org.postgresql.jdbc.PgConnection@a09d66] **
d05203b3 7495225 [http-bio-8080-exec-4] WARN org.openbravo.util.db.DBPoolLogger - ===================== ACTIVE - Tue Jun 20 14:46:00 CEST 2017 - 1497962760375 - PooledConnection[org.postgresql.jdbc.PgConnection@1f86c68a]
  Thread: http-bio-8080-exec-4
   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.OBDal.getConnection(OBDal.java:193)
   org.openbravo.service.db.DalConnectionProvider.getConnection(DalConnectionProvider.java:98)
   org.openbravo.service.db.DalConnectionProvider.getPreparedStatement(DalConnectionProvider.java:161)
   org.openbravo.base.secureApp.SeguridadData.loggedOK(SeguridadData.java:192)

---
[1] http://centralrepository.openbravo.com/openbravo/org.openbravo.forge.ui/sso/ForgeModuleDetail/DB-Pool-Logging-Utilities [^] [^] [^]
Those requests for components without visual representation can avoid to be tried to be translated by xmlEngine, in this way:
- No extra connection will be borrowed
- Some queries will be prevented
Performance
related to defect 0035855 closed alostale many standard requests borrow more than one connection from DB 
related to feature request 0035386 closed caristu Login page needs some clean up 
related to defect 0036300 closed alostale double request to Dynamic.js when opening Book process 
related to defect 0036352 acknowledged Triage Platform Base Still there are requests for standard 2.50 buttons that borrow 2 connections 
Issue History
2017-06-20 14:48alostaleNew Issue
2017-06-20 14:48alostaleAssigned To => platform
2017-06-20 14:48alostaleModules => Core
2017-06-20 14:48alostaleTriggers an Emergency Pack => No
2017-06-20 14:49alostaleAssigned Toplatform => alostale
2017-06-20 14:49alostaleReview Assigned To => caristu
2017-06-20 14:49alostaleRelationship addedrelated to 0035855
2017-06-20 14:50alostaleRelationship addedrelated to 0035386
2017-06-20 14:53hgbotCheckin
2017-06-20 14:53hgbotNote Added: 0097512
2017-06-20 14:53hgbotStatusnew => resolved
2017-06-20 14:53hgbotResolutionopen => fixed
2017-06-20 14:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3d998773a0858e157a07a72cc37994785179e4cf [^]
2017-06-20 15:01alostaleSummaryVerticalMenu.html borrows 2 connections => many request for standard 2.50 buttons borrow 2 connections
2017-06-20 15:01alostaleDescription Updatedbug_revision_view_page.php?rev_id=15385#r15385
2017-06-20 15:01alostaleProposed Solution updated
2017-06-20 15:13hgbotCheckin
2017-06-20 15:13hgbotNote Added: 0097513
2017-06-20 15:13hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/3d998773a0858e157a07a72cc37994785179e4cf [^] => http://code.openbravo.com/erp/devel/pi/rev/78e81f76490d85b73ae0cf9d3689e7a589d7014e [^]
2017-06-20 15:38alostaleTag Attached: Performance
2017-06-20 15:41alostaleRelationship addedrelated to 0036300
2017-06-20 15:57alostaleSummarymany request for standard 2.50 buttons borrow 2 connections => many requests for standard 2.50 buttons borrow 2 connections
2017-06-21 23:43hudsonbotCheckin
2017-06-21 23:43hudsonbotNote Added: 0097568
2017-06-21 23:43hudsonbotCheckin
2017-06-21 23:43hudsonbotNote Added: 0097569
2017-06-26 19:40caristuNote Added: 0097684
2017-06-26 19:40caristuStatusresolved => closed
2017-06-26 19:40caristuFixed in Version => 3.0PR17Q3
2017-06-27 08:34caristuRelationship addedrelated to 0036352

Notes
(0097512)
hgbot   
2017-06-20 14:53   
Repository: erp/devel/pi
Changeset: 3d998773a0858e157a07a72cc37994785179e4cf
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jun 20 14:49:17 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/3d998773a0858e157a07a72cc37994785179e4cf [^]

fixed bug 36299: VerticalMenu.html borrows 2 connections

  Do not translate xmlEngine document in this way:
   - No extra connection is acquired
   - No need to execute extra DB queries

---
M src/org/openbravo/erpCommon/utility/VerticalMenu.java
---
(0097513)
hgbot   
2017-06-20 15:13   
Repository: erp/devel/pi
Changeset: 78e81f76490d85b73ae0cf9d3689e7a589d7014e
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Jun 20 15:13:00 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/78e81f76490d85b73ae0cf9d3689e7a589d7014e [^]

fixed bug 36299: do not translate frameset page

---
M src-wad/src/org/openbravo/wad/javasource.javaxml
---
(0097568)
hudsonbot   
2017-06-21 23:43   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5e0471c14ef8 [^]
Maturity status: Test
(0097569)
hudsonbot   
2017-06-21 23:43   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/5e0471c14ef8 [^]
Maturity status: Test
(0097684)
caristu   
2017-06-26 19:40   
Code reviewed + testing OK: the double connection for TranslationHandler.processTranslations is now not borrowed.