[hibernate-users] DB Connection Timeout

J. Davison de St. Germain dav at sci.utah.edu
Tue Mar 6 17:08:43 EST 2007


Hi,

  I'm using the java version of Hibernate (is there another version?), 
so I assume that it doesn't matter what OS I'm using, Hibernate will 
take care of the connections for me (via java).  So I'm not sure what 
you mean by applying network layer settings.

  However, I did find somewhere the suggestion of doing this:

DriverManager.setLoginTimeout(5);
(before my openSession() call.)

However, this didn't do anything (which actually is what most people 
reported about it). 

I am somewhat at a loss as to how this can be so hard and have no 
documentation.  I would assume that every single application that uses 
Hibernate would have in its first several statements a setting of the 
login timeout and a catch of the "no connection" exception.

Again, I very much appreciate any and all help.

        Thanks,
                 Davison


Robert Klemme wrote:
> 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
>


-- 
-----------------------------------------------------------------------
- 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                -
-----------------------------------------------------------------------





More information about the hibernate-users mailing list