Dear Gert,
You are right .. it seems that m pb is residing in the Get University method, sometime it works sometimes not .. anyways, i've added the tx.commit() and i'm still having the arbitrary same old issue, here is an extract of my code:
Code:
public IList GetUniversityClasses()
Code:
{
session.Reconnect();
ITransaction tx = session.BeginTransaction();
IList retrievedUniClasses = null;
try
{
retrievedUniClasses = session.CreateCriteria(typeof(DataTutorials.BLL.UniversityClass)).List();
}
catch (Exception ex)
{
tx.Rollback();
string errormsg = ex.Message;
throw new ArgumentOutOfRangeException("DBHandler - ERROR IN getUniversityClasses ", ex, ex.Message);
}
tx.Commit();
session.Disconnect();
return retrievedUniClasses;
}
Code:
public UniversityClass GetUniversityClass(int ClassID)
Code:
{
session.Reconnect();
ITransaction tx = session.BeginTransaction();
UniversityClass retrievedUniClass = null;
try
{
retrievedUniClass = (UniversityClass)session.Load(typeof(DataTutorials.BLL.UniversityClass), ClassID);
}
catch (Exception ex)
{
tx.Rollback();
throw new ArgumentOutOfRangeException("DBHandler - ERROR IN Getting Universitu Class ", ex, ex.Message);
}
tx.Commit();
session.Disconnect();
return retrievedUniClass;
}
Code:
public void DeleteUniversityClass(UniversityClass UniClass)
Code:
{
session.Reconnect();
ITransaction tx = session.BeginTransaction();
try
{
//session.deleteItem(Item);
session.Delete(UniClass);
tx.Commit();
}
catch (Exception ex)
{
tx.Rollback();
throw new ArgumentOutOfRangeException(ex.Message, ex, ex.Message);
}
session.Disconnect();
}
Code:
public void INSERT_UniversityClass(int id, string name, string number, string syllabus, DateTime startdate,int dept)
Code:
{
UniversityClass UniClass = new UniversityClass(id, name, number, syllabus, startdate);
Department Depart=dbManager.GetDepartment(dept);
// Assigning that dept to our UniClass
UniClass.Dept = Depart;
dbManager.SaveUniversityClass(UniClass);
// Hooray ! Fixture is successfully DONE
// There is no need to save our UniversityClass --> It is already saved and assigned to the Department ..
//dbManager.SaveUniversityClass(UniClass);
}
[color=blue]Is there any ideas or suggestions ? :(
Thanks for ur time,
Jojo[/color]