These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate freezes when connection get lost
PostPosted: Thu Dec 18, 2008 1:22 am 
Newbie

Joined: Thu Dec 18, 2008 12:46 am
Posts: 1
Hi,
sometimes while I load data from DB the server goes down (which is problem of the database server), however hibernate stops working (freezes) instead of throwing any exception as supposed. It happens only with MySql server, with MsSql everthing works fine (exception is thrown when connection get lost).

Here is a sample:

Code:
session.CreateCriteria(typeof (EshopItem)).List();

loading of the data takes about 5s, if during the loading server goes down the line of code above never ends, however when I load the data using ADO connection, as below, everthing works fine (exeption is thrown when lost connection):

Code:
var con = new MySqlConnection("...");
con.Open();       
var cmd = new MySqlCommand("SELECT * FROM item", con);           
foreach (object o in cmd.ExecuteReader())
{
       ...
}
con.Close();


I've tried explicitly set timeout for the query but without success:
Code:
session.CreateCriteria(typeof (EshopItem)).SetTimeout(10).List();


It happens either with NHibernate 1.2.1 and NHibernate 2.0.1
I'm using MySql 5.0 with .NET connector 5.2.3.0

Thanks for any suggestions.

Petr


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.