Hi,
im accessing a database table with NHibernate (Version 2.1.2). The table contains one binary column (and some other string columns). My data object uses a byte array to store this column.
It works fine to insert and to read records of this table with NHibernate.
I insert at some files with defined file sizes from 1 Byte to 25 MB, in total 280 MB of Data in 55 files. This procedure is repeated 50 times. But after about 20 to 25 times there is a OutofMemoryException.
Do you have any idea what is going wrong or what i can do to solve this problem?
Here is my source code:
Code:
void IDocbaseEntryRepository.Add(DocbaseEntry docbaseEntry)
{
using (ISession session = NHibernateHelper.OpenSession())
using (ITransaction transaction = session.BeginTransaction())
{
try
{
session.Save(docbaseEntry);
transaction.Commit();
}
catch (Exception ex)
{
aLogger.ErrorException("Hibernate-Error: ", ex);
transaction.Rollback();
throw ex;
}
finally
{
session.Clear();
session.Close();
}
}
}