cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Connection Pool Reconnects
Date Wed, 01 Nov 2017 07:23:43 GMT
Hi Melvin,

Don't have much recent experience with SQLServer specifically, but as a general advise for
better control of such things I would recommend using a third-party connection pool such as
DBCP2 [1], Tomcat [2] or Hikari [3] (everyone's favorite as of late). All of them have manny
more knobs that you can turn compared to Cayenne built-in DataSource. E.g. Tomcat DataSource
has 'removeAbandoned' and 'removeAbandonedTimeout' settings that allow to get rid of the stuck
connections, which sounds like something that can help here.

There are a few ways you can install a custom DataSource in Cayenne. The easiest is via API
when starting ServerRuntime:

  ServerRuntime r = ServerRuntime.builder().dataSource(myDS).build();

Andrus

[1] https://commons.apache.org/proper/commons-dbcp/
[2] https://tomcat.apache.org/tomcat-8.0-doc/jdbc-pool.html
[3] https://github.com/brettwooldridge/HikariCP

> On Oct 31, 2017, at 5:26 PM, Melvin Ramos <Melvin.ramos@amphorainc.com> wrote:
> 
> Hello all,
> 
> 
> I was wondering if you can help with my current issue.
> 
> 
> I connect to our Database (SQL Server) via VPN tunnel. When I forcefully bounce our VPN
connection and let the application to continue its process. It just hangs and do nothing.
> 
> 
> What it the best way for the cayenne pool to detect connection failure? Is there a way
to force connection when it needs it?
> 
> 
> Please advice.
> 
> 
> Melvin
> 

Mime
View raw message