Hibernate version: 1.0.5000.0
Name and version of the database you are using: SQL Server 2005
My Problem is in this peace of code
The code in the Service
Code:
public void SaveArtifactsToTemplatesMapping(Hashtable artifactsFileStreams, string[] FileNames, Person aUserID, ProcessDefinition process)
{
// Authorize user can update attachment
DataAccessManager dao = new DataAccessManager();
try
{
// open transaction
dao.BeginTransaction();
// tell attachments manager to map artifacts to templates
_attachmentManager.MapArtifactsToTemplates(artifactsFileStreams, FileNames, process);
dao.FlushSession();
dao.CommitTransaction();
}
catch (BusinessValidationException be)
{
dao.RollbackTransaction();
throw be;
}
catch (Exception e)
{
dao.RollbackTransaction();
throw new Exception("Exception in RenameeAttachment", e);
}
finally
{
if (dao.IsOpen)
{
dao.Dispose();
}
}
}
The code in the manager
Code:
_dao.UpdateAttachment(attachment);
the code in the Data access object
Code:
public void UpdateAttachment(AbstractAttachment anAttachment)
{
base.Save(anAttachment);
}
the code in the base
Code:
public virtual void Save(Object BusinessObject)
{
try
{
session.SaveOrUpdate(BusinessObject);
}
catch (Exception ex)
{
// handle exception
throw new DataAccessException(1402001, ex);
}
}
the Save action (or update) is not performed although there is not any errors or exceptions.
also, If i put this flush statement
Code:
_dao.FlushSession();
after the update command in the manager, it work correctly. but I don't want to do that because it's not logic and I want to know what is the logical solution.
I wait your advices.
Thank you for advance