[hibernate-users] DB Connection Timeout

Robert Klemme shortcutter at googlemail.com
Tue Mar 6 15:23:10 EST 2007


2007/3/6, J. Davison de St. Germain <dav at sci.utah.edu>:
> Hi,
>
>    Yes, I've seen some things about C3P0... however it seems that you
> should be able to do this without it... Also, the configuration item in
> C3P0 doesn't seem to be what I want.  From web searching I have found a
> comment that says that hibernate.c3p0.timeout is for "maximum idle time
> for a connection"... I don't quite know what that means... I'm not

It's the max time that a connection sits idle in the pool before
really being closed.

> concerned with the connection sitting idle... I'm concerned with it not
> connecting in the first place.

Another idea: Depending on your OS you might be able to apply a
network layer setting,

robert


>     Thanks again for your input.  Hopefully others will have other
> suggestions as well.
>
>              Sincerely,
>                     Davison
>
> Robert Klemme wrote:
> > I'd check connection pool settings.  Timeout is likely found there.
> > Hibernate usually uses C3P0.
> >
> > Kind regards
> >
> > robert
> >
> > 2007/3/6, J. Davison de St. Germain <dav at sci.utah.edu>:
> >> Hi,
> >>
> >>  I've searched the web and read through a lot of documentation, but I
> >> can't seem to find out how to do what I think should be a very simple
> >> task.  I want to specify how long hibernate will wait before it returns
> >> from a DB connection attempt.  I'm trying to test my code to ensure that
> >> it behaves correctly when the DB is down.  But testing takes forever
> >> because every time I run the code, it takes about a minute to timeout
> >> and throw the "no connection" exception.  I know there has to be a way
> >> (programmatically (and also via the config file)) to tell hibernate to
> >> only wait, say, 5 seconds before throwing the exception.  Any help you
> >> could provide me would be greatly appreciated.
> >>
> >>          Sincerely,
> >>                     Davison
> >>
> >
> >
>
>
> --
> -----------------------------------------------------------------------
> - J. Davison de St. Germain         dav at cs.utah.edu    (801) 581-4078 -
> - Chief Software Engineer           http://www.cs.utah.edu/~dav       -
> - SCI Institute, SE C-SAFE          University of Utah                -
> -----------------------------------------------------------------------
>
>
> _______________________________________________
> hibernate-users mailing list
> hibernate-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-users
>


-- 
Have a look: http://www.flickr.com/photos/fussel-foto/



More information about the hibernate-users mailing list