Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036228Openbravo ERPA. Platformpublic2017-06-12 13:462017-06-16 10:29
normalminorhave not tried
0036228: SimpleCallout used as ConnectionProvider borrows 2 connections in same thread
When a SimpleCallout is used as ConnectionProvider (using this to get connection), it borrows a second connection in the thread in addition to the Dal's one.
1. Install DB Pool log module [1]
2. Configure to log threads borrowing more than one connection:
3. Login as Openbravo admin
4. Open any draft Sales Order
5. Change it's BP
  -> Check log:
d05203b3 1680166 [http-bio-8080-exec-3] WARN org.openbravo.util.db.DBPoolLogger - ***** Trying to get a connection in a thread that already has an active connection.

[1] [^]
related to defect 0035855 closed alostale many standard requests borrow more than one connection from DB 
related to design defect 0036067 closed markmm82 old callouts should be refactored to implement SimpleCallout 
depends on design defect 00323663.0PR16Q4 closed inigosanchez callout invocation ineficiencies 
Issue History
2017-06-12 13:46alostaleNew Issue
2017-06-12 13:46alostaleAssigned To => alostale
2017-06-12 13:46alostaleModules => Core
2017-06-12 13:46alostaleTriggers an Emergency Pack => No
2017-06-12 13:47alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15328#r15328
2017-06-12 13:47alostaleRelationship addeddepends on 0032366
2017-06-12 13:47alostaleRelationship addedrelated to 0035855
2017-06-12 13:48alostaleReview Assigned To => caristu
2017-06-12 13:48alostaleTag Attached: Performance
2017-06-12 13:54alostaleRelationship addedrelated to 0036067
2017-06-12 13:54hgbotCheckin
2017-06-12 13:54hgbotNote Added: 0097313
2017-06-12 13:54hgbotStatusnew => resolved
2017-06-12 13:54hgbotResolutionopen => fixed
2017-06-12 13:54hgbotFixed in SCM revision => [^]
2017-06-13 07:41hudsonbotCheckin
2017-06-13 07:41hudsonbotNote Added: 0097337
2017-06-16 10:29caristuNote Added: 0097437
2017-06-16 10:29caristuStatusresolved => closed
2017-06-16 10:29caristuFixed in Version => 3.0PR17Q3

2017-06-12 13:54   
Repository: erp/devel/pi
Changeset: be9628eb622282df600ce09ebd6be7ae5fb0375b
Author: Asier Lostalé <asier.lostale <at>>
Date: Mon Jun 12 13:52:53 2017 +0200
URL: [^]

fixed bug 36228: SimpleCallout borrows 2 connections in same thread

  When a SimpleCallout is used as ConnectionProvider (using this to get
  connection), it borrows a second connection in the thread in addition to the
  Dal's one.

  Fixed by obtaining ConnectionProvider instance from DAL's one, so that
  it reuses the same connection already borrowed in current thread.

  Note this is safe as callout instances are not shared among different threads.

M src/org/openbravo/erpCommon/ad_callouts/
2017-06-13 07:41   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test
2017-06-16 10:29   
Code reviewed + testing OK.