Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035911Openbravo ERP07. Sales managementpublic2017-05-03 16:502017-06-15 12:15
egoitz 
collazoandy4 
normalmajoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
No
0035911: Executing copy lines process without selecting an invoice produces a connection leak
If you execute the copy lines process on an invoice and you click on ok button before you select an invoice, a connection is opened but not closed
-Create an invoice
-Click on the copy lines button
-Click on ok without selecting any invoice.
*See on the pg_stat_activity that you have an entry with state='idle in transaction'

The problem is that you are executing a return without closing the connection.

      if (data == null || data.length == 0) {
        myError = new OBError();
        myError.setType("Success");
        myError.setTitle(OBMessageUtils.messageBD("Success"));
        myError.setMessage(OBMessageUtils.messageBD("RecordsCopied") + " " + i);
        return myError;
      }

You could execute the rollback before the return or on the finally.
No tags attached.
Issue History
2017-05-03 16:50egoitzNew Issue
2017-05-03 16:50egoitzAssigned To => Triage Finance
2017-05-03 16:50egoitzModules => Core
2017-05-03 16:50egoitzResolution time => 1495576800
2017-05-03 16:50egoitzTriggers an Emergency Pack => No
2017-05-04 16:50aferrazAssigned ToTriage Finance => collazoandy4
2017-05-04 17:18collazoandy4Statusnew => scheduled
2017-05-04 19:22collazoandy4Note Added: 0096401
2017-05-04 19:26hgbotCheckin
2017-05-04 19:26hgbotNote Added: 0096402
2017-05-04 19:26hgbotStatusscheduled => resolved
2017-05-04 19:26hgbotResolutionopen => fixed
2017-05-04 19:26hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3851147e5fd82607a74e35873fa214b85fa81f73 [^]
2017-05-04 19:26aferrazReview Assigned To => aferraz
2017-05-04 19:26aferrazNote Added: 0096403
2017-05-04 19:26aferrazStatusresolved => closed
2017-05-04 19:26aferrazFixed in Version => 3.0PR17Q3
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096944
2017-06-15 12:15egoitzSummaryExecution copy lines process without selecting an invoice produces a memory leak => Executing copy lines process without selecting an invoice produces a connection leak

Notes
(0096401)
collazoandy4   
2017-05-04 19:22   
Test Plan
  As group admin role:
    Go to Sales Invoice windows and create a new record:
      Business Partner: Alimentos y Supermercados, S.A
    Clic on Copy Lines button
    Cic OK button and check in pg_stat_activity that no new iddle connection was created
(0096402)
hgbot   
2017-05-04 19:26   
Repository: erp/devel/pi
Changeset: 3851147e5fd82607a74e35873fa214b85fa81f73
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Thu May 04 13:08:22 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/3851147e5fd82607a74e35873fa214b85fa81f73 [^]

Fixes issue 35911: Memory leak in copy lines process without selecting invoice

If you execute the copy lines process on an invoice and you click on ok button
before you select an invoice, a connection is opened but not closed.

Now a releaseRollbackConnection(conn) is made when no data have been selected.

---
M src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java
---
(0096403)
aferraz   
2017-05-04 19:26   
Code review + Testing OK
(0096944)
hudsonbot   
2017-05-29 17: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/1ee70113bdc4 [^]
Maturity status: Test