FNH 1.1.0.695 broke my automapping of Lists!

Tom Bushell's Avatar

Tom Bushell

29 Oct, 2010 11:14 PM via web

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; }
    ...
}
  1. Support Staff 2 Posted by James Gregory on 30 Oct, 2010 11:03 AM

    James Gregory's Avatar

    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:

  2. 3 Posted by Tom Bushell on 01 Nov, 2010 03:27 PM

    Tom Bushell's Avatar

    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

  3. Support Staff 4 Posted by James Gregory on 01 Nov, 2010 03:35 PM

    James Gregory's Avatar

    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.

  4. 5 Posted by Tom Bushell on 01 Nov, 2010 04:11 PM

    Tom Bushell's Avatar

    Just downloaded build 686 from the 1.x branch on the Teamcity site, and it has the same problem.

    -Tom

  5. Support Staff 6 Posted by James Gregory on 01 Nov, 2010 04:28 PM

    James Gregory's Avatar

    Hmm, well that's definitely not good! I'll investigate.

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What number comes after 20?