Open GoogleCodeExporter opened 9 years ago
Can you please provide a code sample that can recreate this? Are you calling a
SubmitChanges (flush) after you make the initial changes to our entities?
Original comment by tdupont...@gmail.com
on 14 Jun 2010 at 3:14
What we do is ensure that each object we get has a mgr.Refresh() call to it.
For example:
public MyEntity GetEntity(long id)
{
IMyEntityManager mgr = new ManagerFactory().GetMyEntityManager();
MyEntity obj = mgr.GetById(id);
if(obj != null) {
mgr.Refresh(obj);
}
return obj;
}
Hope this helps either the way you code against the NHibernate templates.
Original comment by wayne.ma...@gmail.com
on 18 Nov 2010 at 3:17
Hello,
Each Manager should be wrapped in an using block. Can you please see if the
following code resolves this issue.
public MyEntity GetEntity(long id)
{
MyEntity obj = null;
using(IMyEntityManager mgr = new ManagerFactory().GetMyEntityManager())
{
obj = mgr.GetById(id);
if(obj != null) {
mgr.Refresh(obj);
}
}
return obj;
}
Original comment by bniemyjski
on 23 Nov 2010 at 11:08
Original issue reported on code.google.com by
huanh...@gmail.com
on 14 Jun 2010 at 10:05