james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Levesque <suriv...@gmail.com>
Subject Re: Data Source Pool is not validating connections
Date Tue, 01 May 2018 20:49:47 GMT
My solution is working, so I created
https://issues.apache.org/jira/browse/JAMES-2386 and a pull request. Enjoy

On 30 April 2018 at 22:02, Simon Levesque <surivorp@gmail.com> wrote:

> Hello,
>
> 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:
>   Caused by: java.sql.SQLNonTransientConnectionException: (conn=17)
> unexpected end of stream, read 0 bytes from 4 (socket was closed by server)
>
> So I thought that there must be an issue with the configuration of the
> BasicDataSource and I saw these properties are not set and cannot be set:
>   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);
>
> Are you interested in a fix and is my approach good:
> - Let user set 3 parameters in james-database.properties with the
> "database." prefix
> - update these files which creates the BasicDataSource with these
> properties:
>   - mailbox-jpa.xml
>   - jdbc.xml
>   - spring-server.xml
>
> If that is fine, I will create a Jira and a fix.
>
> thanks
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message