I am not sure if current version has this, but  DIH used to reload
connections after some idle time

if (currTime - connLastUsed > CONN_TIME_OUT) {
                        synchronized (this) {
                                Connection tmpConn = factory.call();
                                closeConnection();
                                connLastUsed = System.currentTimeMillis();
                                return conn = tmpConn;
                        }


Where CONN_TIME_OUT = 10 seconds



On Fri, Sep 2, 2011 at 12:36 AM, Chris Hostetter
<hossman_luc...@fucit.org> wrote:
>
> : However, I tested this against a slower SQL Server and I saw
> : dramatically worse results. Instead of re-using their database, each of
> : the sub-entities is recreating a connection each time the query runs.
>
> are you seeing any specific errors logged before these new connections are
> created?
>
> I don't *think* there's anything in the DIH JDBC/SQL code that causes it
> to timeout existing connections -- is it possible this is sometihng
> specific to the JDBC Driver you are using?
>
> Or maybe you are using the DIH "threads" option along with a JNDI/JDBC
> based pool of connections that is configured to create new Connections on
> demand, and with the fast DB it can reuse them but on the slow DB it does
> enough stuff in parallel to keep asking for new connections to be created?
>
>
> If it's DIH creating new connections over and over then i'm pretty sure
> you should see an INFO level log message like this for each connection...
>
>        LOG.info("Creating a connection for entity "
>                + context.getEntityAttribute(DataImporter.NAME) + " with URL: "
>                + url);
>
> ...are those messages different against you fast DB and your slow DB?
>
> -Hoss
>

Reply via email to