[
https://issues.apache.org/jira/browse/OFBIZ-7344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331543#comment-15331543 ]
Gareth Carter commented on OFBIZ-7344:
--------------------------------------
I tested again. Without the patch, the connections stayed idle even after a long period of time (~1 hour). With the patch, these disappear after ~10 mins. It may not be obvious that the connections stay idle and not reused after startup. But different environments could cause different behaviours.
Atleast the patch fixes bad practice (not closing resources after use!)
Also, I would note I only noticed this issue because running the query 'select * from pg_stat_activity' showed idle connections established days before and query_start roughly the same as backend_start.
> db connections remain open and unused on startup
> ------------------------------------------------
>
> Key: OFBIZ-7344
> URL:
https://issues.apache.org/jira/browse/OFBIZ-7344> Project: OFBiz
> Issue Type: Bug
> Components: ALL COMPONENTS
> Affects Versions: Trunk
> Reporter: Gareth Carter
> Assignee: Jacques Le Roux
> Priority: Minor
> Fix For: 14.12.01, 15.12.01
>
> Attachments: DatabaseUtil.patch
>
>
> When ofbiz starts and checks the database, it will leave open connections and will not get reused.
> If you run Check/Update database from webtools, you can see a new connection is created for your selected group
> As far as I can tell, the problem lies in DatabaseUtil.getDatabaseMetaData. If the parameter connection is null, a new connection object is created but not closed (like any resource should be!)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)