You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "ASF GitHub Bot (JIRA)" <se...@james.apache.org> on 2018/05/01 20:48:00 UTC
[jira] [Commented] (JAMES-2386) Data Source Pool is not validating
connections
[ https://issues.apache.org/jira/browse/JAMES-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16460132#comment-16460132 ]
ASF GitHub Bot commented on JAMES-2386:
---------------------------------------
GitHub user provirus opened a pull request:
https://github.com/apache/james-project/pull/113
JAMES-2386 Datasource validation is configurable
My fix includes:
- instructions in comments in file `james-database.properties`
- default values when not set are the current ones: no validation
- can set the 3 variables
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/foilen/james-project JAMES-2386
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/james-project/pull/113.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #113
----
commit 46e91e8b0cbad4b51fc3f2fad1d53049107faf39
Author: Simon Levesque <si...@...>
Date: 2018-05-01T11:30:13Z
JAMES-2386 Datasource validation is configurable
----
> Data Source Pool is not validating connections
> ----------------------------------------------
>
> Key: JAMES-2386
> URL: https://issues.apache.org/jira/browse/JAMES-2386
> Project: James Server
> Issue Type: Improvement
> Components: JDBC, jpa
> Affects Versions: master
> Reporter: Simon Levesque
> Priority: Minor
> Fix For: master
>
>
> I was seeing a couple exceptions in different calls: * Getting the list of emails via imap
> * Reading the emails via imap
> * Sending emails
> * Resolving the rewrite table
> * even in my personal mailet
>
> The only thing in common was the "cause" of the exception:
> {noformat}
> Caused by: java.sql.SQLNonTransientConnectionException: (conn=17) unexpected end of stream, read 0 bytes from 4 (socket was closed by server){noformat}
>
> I found that there must be an issue with the configuration of the BasicDataSource and I saw these properties are not set and cannot be set:
>
> {code:java}
> basicDataSource.setTestOnBorrow(true);
> basicDataSource.setValidationQuery("select 1"); // Is different by database. See list here: https://stackoverflow.com/questions/10684244/dbcp-validationquery-for-different-databases
> basicDataSource.setValidationQueryTimeout(2);
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org