public Object refreshObject(final Object obj)
throws PersistenceException
{
if (obj != null)
{
TransactionGuard tg = new TransactionGuard(this);
try
{
if (obj instanceof PersistentObjectBase)
{
((PersistentObjectBase) obj).flagAsUnloaded();
}
getHibernateSession().refresh(obj);
}
catch (UnresolvableObjectException e)
{
tg.doCatch();
String msg = LogUtil.error(getClass(), "Persistence error.", e);
throw new PersistentObjectNotFoundException(msg, e);
}
catch (HibernateException e)
{
tg.doCatch();
throw createLoggedException(e);
}
finally
{
tg.doFinally();
}
}
return obj;
}