The trunk don't resolve this problem in Burrow with Multiple databases.
In my GenericDAO, there is a method to bring a good ISession :
protected ISession Session
{
get
{
string PersitenceUnitToUse = (string)new
AppSettingsReader().GetValue("persistenceUnit", typeof(String));
if (string.IsNullOrEmpty(PersitenceUnitToUse))
return new BurrowFramework().GetSession(_NHTypeEntite);
else
return new
BurrowFramework().GetSession(PersitenceUnitToUse);
}
}
But i think some times NH automaticaly put a ISession (when data changed for
example) and without called my ISession Session method. And i can see that
NH give the first PersitentUnit ;(
In this case where can i precise my ISession logic ?
for details : The exception i have when NH use the wrong PersistentUnit
(...)
in SessionImpl.cs in the method :
public object GetIdentifier(object obj)
if (obj is INHibernateProxy) { (..) }
else
{
EntityEntry entry = persistenceContext.GetEntry(obj); *//HERE IS THE
PROBLEM : not the good persistenceContext ?!
* if (entry == null) //entry is not find :(
{
throw new TransientObjectException("the instance was not
associated with this session");
}
return entry.Id;
}
and the stack trace :
[TransientObjectException: the instance was not associated with this
session]
NHibernate.Impl.SessionImpl.GetIdentifier(Object obj) in
C:\DICSIT\nouveau\sources\NHibernate\Impl\SessionImpl.cs:1268
NHibernate.Burrow.Util.EntityLoader.GetId(Object o) in
C:\DICSIT\nouveau\sources\NHibernate.Burrow\Util\EntityLoader.cs:62
NHibernate.Burrow.WebUtil.Impl.EntityVSFInterceptorBase.OnSave(Object
toSave, Object objectInStateContainer) in
C:\DICSIT\nouveau\sources\NHibernate.Burrow.WebUtil\Impl\EntityVSFInterceptor.cs:16
NHibernate.Burrow.WebUtil.Impl.StatefulFieldSaver.ProcessFields() in
C:\DICSIT\nouveau\sources\NHibernate.Burrow.WebUtil\Impl\StatefulFieldSaver.cs:23
NHibernate.Burrow.WebUtil.Impl.StatefulFieldProcessor.Process() in
C:\DICSIT\nouveau\sources\NHibernate.Burrow.WebUtil\Impl\StatefulFieldProcessor.cs:40
NHibernate.Burrow.WebUtil.Impl.StatefulFieldPageModule.page_PreRenderComplete(Object
sender, EventArgs e) in
C:\DICSIT\nouveau\sources\NHibernate.Burrow.WebUtil\Impl\StatefulFieldPageModule.cs:66
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +2063008
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2247
Thanks for your help !
JbM
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---