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