Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0049285Openbravo ERPA. Platformpublic2022-05-10 17:122022-05-11 08:41
caristu 
caristu 
immediatemajorhave not tried
closedfixed 
5
 
PR22Q3 
Core
No
0049285: DB transaction is left opened after executing the test connectivity process
After executing the test connectivity process for an HTTP external system, a DB transaction is left opened
1) Login
2) Execute the query: select count(*) from pg_stat_activity where state ilike '%in transaction%'; --> count result is 0
3) Go to the External System window, create a new HTTP external system with all the required information
4) Click on the "Test" button
5) Execute the query again: select count(*) from pg_stat_activity where state ilike '%in transaction%'; --> WRONG: now count result is 1
No tags attached.
caused by feature request 0048579 closed caristu Push API 
Issue History
2022-05-10 17:12caristuNew Issue
2022-05-10 17:12caristuAssigned To => caristu
2022-05-10 17:12caristuModules => Core
2022-05-10 17:12caristuTriggers an Emergency Pack => No
2022-05-10 17:36hgbotNote Added: 0137134
2022-05-10 17:37caristuRelationship addedcaused by 0048579
2022-05-11 07:52hgbotNote Added: 0137136
2022-05-11 07:52hgbotResolutionopen => fixed
2022-05-11 07:52hgbotStatusnew => closed
2022-05-11 07:52hgbotFixed in Version => PR22Q3
2022-05-11 07:52hgbotNote Added: 0137137
2022-05-11 08:41alostaleSeverityminor => major

Notes
(0137134)
hgbot   
2022-05-10 17:36   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/591 [^]
(0137136)
hgbot   
2022-05-11 07:52   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/591 [^]
(0137137)
hgbot   
2022-05-11 07:52   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: deb8e248c0233e75f7c9e0dfde6f6cc5bb58b933
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 10-05-2022 15:42:40
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/deb8e248c0233e75f7c9e0dfde6f6cc5bb58b933 [^]

fixes BUG-49285: test connectivity process leaves an opened DB transaction

  In the test connectivity process we are making use of the thenApply
method of the CompletableFuture returned by the External System API to
build the process result with the information coming from the send
method.

  Altough we are consuming this API in a synchronous way, our lambda
executed in the thenApply is executed in a separate thread which is
making use of DAL to get the AD messages that are included in the
process result.

  For this reason we have to manually close the DAL connection
(transaction) in our lambda as this thread will not by controlled by the
standard flow which makes use of the DalThreadFilter to close the
connections.

---
M src/org/openbravo/service/externalsystem/process/CheckConnectivity.java
---