FNH 1.1.0.695 broke my automapping of Lists!
Today, I upgraded to the latest build of FNH - 1.1.0.695 (I downloaded the binaries).
When I automapped my classes, and tried to save data, I got a "No persistor for
OfeDlsMeasurement" exception. This had all worked fine in the previous version I
have been using (1.1.0.629), and started working again when I rolled back the DLLs.
I used the new Diagnostics method (kudos to James Gregory!), and believe I see where the
problem is.
If you look at the dump below, you'll see that all the types that begin with "Diam" are
in the Candidate list, but missing from the Mapped list.
It turns out that these are all "empty" classes, which are defined to work around the known
FNH/NH limitation that you can't have Lists of the same type in the same class (I've appended
excerpted class definitions below).
This used to work, so it looks like a new bug to me.
Of course, if I'm doing something wrong here, please let me know.
-Tom Bushell
=====================================================
Candidate types:
DiamIntensityDistributionPeak | BI_OverlordDlsAppCore.DiamIntensityDistributionPeak, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DiamIntensityDistributionResults | BI_OverlordDlsAppCore.DiamIntensityDistributionResults, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null DiamNumberDistributionPeak | BI_OverlordDlsAppCore.DiamNumberDistributionPeak, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DiamNumberDistributionResults | BI_OverlordDlsAppCore.DiamNumberDistributionResults, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DiamSurfaceDistributionPeak | BI_OverlordDlsAppCore.DiamSurfaceDistributionPeak, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DiamSurfaceDistributionResults | BI_OverlordDlsAppCore.DiamSurfaceDistributionResults, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DiamVolumeDistributionPeak | BI_OverlordDlsAppCore.DiamVolumeDistributionPeak, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
DiamVolumeDistributionResults | BI_OverlordDlsAppCore.DiamVolumeDistributionResults, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDistributionResults | BI_OverlordDlsAppCore.OfeDistributionResults, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDlsDistributionPeak | BI_OverlordDlsAppCore.OfeDlsDistributionPeak, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDlsMarkHouwinkSakuradaParams | BI_OverlordDlsAppCore.OfeDlsMarkHouwinkSakuradaParams, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null OfeDlsMeasurement | BI_OverlordDlsAppCore.OfeDlsMeasurement, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDlsMeasurementRun | BI_OverlordDlsAppCore.OfeDlsMeasurementRun, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfePalsMeasurement | BI_OverlordPalsAppCore.OfePalsMeasurement, BI_PalsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeZetapMeasurement | BI_OverlordZetapAppCore.OfeZetapMeasurement, BI_ZetapAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Mapped types:
OfeDistributionResults | BI_OverlordDlsAppCore.OfeDistributionResults, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDlsDistributionPeak | BI_OverlordDlsAppCore.OfeDlsDistributionPeak, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDlsMarkHouwinkSakuradaParams | BI_OverlordDlsAppCore.OfeDlsMarkHouwinkSakuradaParams, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null OfeDlsMeasurementRun | BI_OverlordDlsAppCore.OfeDlsMeasurementRun, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeDlsMeasurement | BI_OverlordDlsAppCore.OfeDlsMeasurement, BI_DlsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfePalsMeasurement | BI_OverlordPalsAppCore.OfePalsMeasurement, BI_PalsAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
OfeZetapMeasurement | BI_OverlordZetapAppCore.OfeZetapMeasurement, BI_ZetapAppCore, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
public abstract class OfeEntity
{
public virtual int Id { get; private set; }
}
public class OfeDistributionResults : OfeEntity
{
...
}
// NHibernate cannot automap more than one IList of the same
// type in a class. These empty classes allow us to have multiple
// lists of DistributionResults, etc - in OfeDlsMeasurementRun
public class DiamIntensityDistributionResults : OfeDistributionResults { }
public class DiamVolumeDistributionResults : OfeDistributionResults { }
public class OfeDlsMeasurementRun : OfeEntity
{
...
public virtual IList<DiamIntensityDistributionResults> DiamIntensityDistributionTable { get; set; }
public virtual IList<DiamVolumeDistributionResults> DiamVolumeDistributionTable { get; set; }
...
}
Support Staff 2 Posted by James Gregory on 30 Oct, 2010 11:03 AM
The master branch is for 2.0 and should be considered "unstable". There will
be breaking changes, and there will be bugs. I would advise you try to stick
to the v1.x branch, as that's what will become the 1.2 release.
That being said, we don't want bugs in 2.0 either so this is useful either
way :)
I'll investigate, thanks.
On Sat, Oct 30, 2010 at 12:23 AM, Tom Bushell <
***@tenderapp.com<tender%***@tenderapp.com>
> wrote:
3 Posted by Tom Bushell on 01 Nov, 2010 03:27 PM
Thanks, James - I had not realized that the 1.x branch was being maintained in parallel with the master branch.
Can I get binaries for the 1.x branch too? Just spent a few minutes on the download page, and at GitHub, but did not see any mention of 1.x binaries.
Thanks,
-Tom Bushell
Support Staff 4 Posted by James Gregory on 01 Nov, 2010 03:35 PM
http://teamcity.codebetter.com has a separate build for the v1.x branch, which generates zip file artefacts. I intend to reorganise the download page a bit soon to incorporate these changes.
5 Posted by Tom Bushell on 01 Nov, 2010 04:11 PM
Just downloaded build 686 from the 1.x branch on the Teamcity site, and it has the same problem.
-Tom
Support Staff 6 Posted by James Gregory on 01 Nov, 2010 04:28 PM
Hmm, well that's definitely not good! I'll investigate.