Hi Morten,
 
Thanks for updating that - I don't have much experience with Subversion.
 
I ran into another bug, this one in the FieldMap class:
 
  public bool IsGenericNullableType
  { get { return memberType.FullName.StartsWith( "System.NullableType" ) && memberType.IsGenericType; }
The type names will actually start with just "System.Nullable".
 
A coworker (Neil McEntaggart) suggested the following alternative to eliminate the string constant:
 
  return memberType.IsGenericType && (memberType.GetGenericTypeDefinition() == typeof(Nullable<>));
 
This bug was rather difficult to locate; there appears to be an issue with the isPerfectMatch field in ConstructorMap. When public IEntity Construct( object[] row, PersistenceBroker broker ) is called, isPerfectMatch can return different values for the same business object and row values. Our unit tests (separate from the Gentle.NET tests) would fail sometimes due to the generic bug (isPerfectMatch was false, so GetParams was called) but would succeed if run individually (isPerfectMatch would then return true). Given the same persistent object and the same row, I would think isPerfectMatch would not vary.
 
Thanks again,
Bill Sorensen
Objects and Infrastructure
Integrated DNA Technologies


From: gopf-devel-bounces@lists.sourceforge.net [mailto:gopf-devel-bounces@lists.sourceforge.net] On Behalf Of Morten Mertner
Sent: Wednesday, April 16, 2008 3:38 PM
To: Gentle development
Subject: Re: [gentle] Bug in Gentle 1.5.0

Hi Bill,

Thanks - fixed in Subversion. I changed the GetDefaultProvider() to call the destination method directly as it saves a method call.

As for the C# 3.0'isms.. to the best of my knowledge these are compiler improvements and not CLR improvements, so the code will run fine on .NET 2.0 despite the use of more modern constructs. For instance, you can use the "var" keyword or the ?? operator and the code still runs fine on a 2.0 CLR. You will need to use the VS 2008 compiler though (aka csc.exe from .NET 3.5), but since the project files are VS 2008 this shouldn't be a major problem.

Yours,
Morten


On Wed, Apr 16, 2008 at 9:44 PM, Bill Sorensen <bsorensen@idtdna.com> wrote:
In ProviderFactory.cs:
 
  public static IGentleProvider GetProvider( Type type )
  {
   NamespaceProvider np = NamespaceProviders.GetNamespaceProvider( type );
   if( np != null )
   {
    return GetProvider( np.ProviderName, np.ConnectionString, np.Schema );  // BUG
   }
   else
   {
    // use the default provider
    return GetProvider( null, null );
   }
  }
The marked line needs to pass a null as the initial parameter to call the correct overload. Here's the corrected source (I also changed the call to get the default provider):
 
  public static IGentleProvider GetProvider( Type type )
  {
   NamespaceProvider np = NamespaceProviders.GetNamespaceProvider( type );
 
   if( np != null )
   {
    return GetProvider( null, np.ProviderName, np.ConnectionString, np.Schema );
   }
   else
   {
     return GetDefaultProvider();
   }
  }
 
 
Bill Sorensen
Objects and Infrastructure
Integrated DNA Technologies


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Gopf-devel mailing list
Gopf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gopf-devel




--
Yours,
Morten