I compiled NHibernate with VS2005 and ran the tests in NHibernate.Test against a SQL2005 database. Test FooBarTest failed on the following assertion at line 2114 in FooBarTest.cs
Assert.IsTrue( NHibernateUtil.IsInitialized( f.TheFoo ) );
The test works fine under VS2003. Comparing SQL Profiler traces from VS2003 and VS2005 shows more SELECT's using VS2003 generated by the statement preceding the assertion
list = s.CreateCriteria( typeof( Foo ) )
.Add( Expression.Expression.Eq( "Integer", f.Integer ) )
. Add( Expression.Expression.Like( "String", f.String ) )
.Add( Expression.Expression.In( "Boolean", new bool[ ] {f.Boolean, f.Boolean} ) )
.Add( Expression.Expression.IsNotNull( "TheFoo" ) )
.SetFetchMode( "TheFoo", FetchMode.Eager )
.SetFetchMode( "Baz", FetchMode.Lazy )
.SetFetchMode( "Component.Glarch", FetchMode.Lazy )
.SetFetchMode( "TheFoo.Baz", FetchMode.Lazy )
.SetFetchMode( "TheFoo.Component.Glarch", FetchMode.Lazy )
.List();
Has anyone else seen this problem?
EDIT - More Info: Here's the log output from the two tests (VS2003 and VS2005).
---> VS2005 log (first 492 lines cut)
2006-03-20 23:05:07,244 [3332] DEBUG NHibernate.Cache.NonstrictReadWriteCache - Caching: 666fd88855f8460c9b5f6f0ed4d5abf5
2006-03-20 23:05:07,244 [3332] DEBUG NHibernate.SQL - SELECT fees0_.fee_id as fee_id__, fees0_.str_ as str___ FROM Fees fees0_ WHERE fees0_.fee_id=@p0
2006-03-20 23:05:07,244 [3332] DEBUG NHibernate.SQL - @p0 = '878c9d1663d3417f933d220eafc1b32f'
2006-03-20 23:05:07,244 [3332] DEBUG NHibernate.SQL - SELECT fees0_.fee_id as fee_id__, fees0_.str_ as str___ FROM Fees fees0_ WHERE fees0_.fee_id=@p0
2006-03-20 23:05:07,244 [3332] DEBUG NHibernate.SQL - @p0 = '98c06625c891453db4b2365ff94bd752'
2006-03-20 23:05:07,337 [3332] ERROR NHibernate.Test.TestCase - Test case didn't close a session, closing
---> remainder of log cut
---> VS2003 log (first 492 lines cut - same as VS2005 log)
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.Cache.NonstrictReadWriteCache - Caching: fa24e972b7194255a8bab64abe92b9ad
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - SELECT bytes0_.id as id__, bytes0_.byte_ as byte___, bytes0_.i as i__ FROM foobytes bytes0_ WHERE bytes0_.id=@p0
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - @p0 = '1fbd515f7ecb4d82be20bed7be52ba78'
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - SELECT fee0_.id_ as id_1_, fee0_.AnotherFee as AnotherFee1_, fee0_.Fi as Fi1_, fee0_.TheFee as TheFee1_, fee0_.Name as Name1_, fee0_.null_prop as null_prop1_, fee0_.Qux as Qux1_, fee0_.count_ as count_1_, fee1_.id_ as id_0_, fee1_.AnotherFee as AnotherFee0_, fee1_.Fi as Fi0_, fee1_.TheFee as TheFee0_, fee1_.Name as Name0_, fee1_.null_prop as null_prop0_, fee1_.Qux as Qux0_, fee1_.count_ as count_0_ FROM [the fees] fee0_ left outer join [the fees] fee1_ on fee0_.AnotherFee=fee1_.id_ WHERE fee0_.id_=@p0
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - @p0 = 'e805c1400f114aadb0428fd18c96a809'
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - SELECT importantd0_.foo_id as foo_id__, importantd0_.date_ as date___, importantd0_.i as i__ FROM foo_times importantd0_ WHERE importantd0_.foo_id=@p0
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - @p0 = '1fbd515f7ecb4d82be20bed7be52ba78'
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - SELECT fee0_.id_ as id_1_, fee0_.AnotherFee as AnotherFee1_, fee0_.Fi as Fi1_, fee0_.TheFee as TheFee1_, fee0_.Name as Name1_, fee0_.null_prop as null_prop1_, fee0_.Qux as Qux1_, fee0_.count_ as count_1_, fee1_.id_ as id_0_, fee1_.AnotherFee as AnotherFee0_, fee1_.Fi as Fi0_, fee1_.TheFee as TheFee0_, fee1_.Name as Name0_, fee1_.null_prop as null_prop0_, fee1_.Qux as Qux0_, fee1_.count_ as count_0_ FROM [the fees] fee0_ left outer join [the fees] fee1_ on fee0_.AnotherFee=fee1_.id_ WHERE fee0_.id_=@p0
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - @p0 = 'eda6376de2924bdab1edbbf167cf133f'
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - SELECT importantd0_.foo_id as foo_id__, importantd0_.date_ as date___, importantd0_.i as i__ FROM foo_dates importantd0_ WHERE importantd0_.foo_id=@p0
2006-03-20 23:08:17,055 [876] DEBUG NHibernate.SQL - @p0 = '1fbd515f7ecb4d82be20bed7be52ba78'
2006-03-20 23:08:17,070 [876] DEBUG NHibernate.Cache.NonstrictReadWriteCache - Caching: 1fbd515f7ecb4d82be20bed7be52ba78
2006-03-20 23:08:17,070 [876] DEBUG NHibernate.SQL - SELECT fees0_.fee_id as fee_id__, fees0_.str_ as str___ FROM Fees fees0_ WHERE fees0_.fee_id=@p0
2006-03-20 23:08:17,070 [876] DEBUG NHibernate.SQL - @p0 = 'eda6376de2924bdab1edbbf167cf133f'
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - SELECT fees0_.fee_id as fee_id__, fees0_.str_ as str___ FROM Fees fees0_ WHERE fees0_.fee_id=@p0
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - @p0 = 'e805c1400f114aadb0428fd18c96a809'
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - SELECT fees0_.fee_id as fee_id__, fees0_.str_ as str___ FROM Fees fees0_ WHERE fees0_.fee_id=@p0
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - @p0 = '04677ff98a644bf58a6d8bcebfaa0a33'
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - SELECT fees0_.fee_id as fee_id__, fees0_.str_ as str___ FROM Fees fees0_ WHERE fees0_.fee_id=@p0
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - @p0 = '91d657a243e54d79851d8149f96c2770'
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - SELECT glarch0_.tha_key as tha_key0_, glarch0_.count_ as count_0_, glarch0_.glarch_ as glarch_0_, glarch0_.order_ as order_0_, glarch0_.next_ as next_0_, glarch0_.X as X0_, glarch0_.Immutable as Immutable0_, glarch0_.[any_id of object] as y10_0_, glarch0_.[any_class of object] as y11_0_, glarch0_.namecvbnmasdf as namecvbn3_0_, glarch0_.version as version0_, glarch0_.foo as foo0_, glarch0_.bar as bar0_ FROM [glarchez] glarch0_ WHERE glarch0_.tha_key=@p0
2006-03-20 23:08:17,211 [876] DEBUG NHibernate.SQL - @p0 = '988219dd25914eb38beff11669cb9a5f'
2006-03-20 23:08:17,289 [876] DEBUG NHibernate.SQL - SELECT proxyarray0_.array_key as array_key__, proxyarray0_.tha_key as tha_key__, proxyarray0_.array_indecks as array_i21___, proxyarray0_.tha_key as tha_key0_, proxyarray0_.count_ as count_0_, proxyarray0_.glarch_ as glarch_0_, proxyarray0_.order_ as order_0_, proxyarray0_.next_ as next_0_, proxyarray0_.X as X0_, proxyarray0_.Immutable as Immutable0_, proxyarray0_.[any_id of object] as y10_0_, proxyarray0_.[any_class of object] as y11_0_, proxyarray0_.namecvbnmasdf as namecvbn3_0_, proxyarray0_.version as version0_, proxyarray0_.foo as foo0_, proxyarray0_.bar as bar0_ FROM [glarchez] proxyarray0_ WHERE proxyarray0_.array_key=@p0
2006-03-20 23:08:17,289 [876] DEBUG NHibernate.SQL - @p0 = '988219dd25914eb38beff11669cb9a5f'
2006-03-20 23:08:17,305 [876] DEBUG NHibernate.SQL - SELECT proxyset0_.set_key as set_key__, proxyset0_.tha_key as tha_key__, proxyset0_.tha_key as tha_key0_, proxyset0_.count_ as count_0_, proxyset0_.glarch_ as glarch_0_, proxyset0_.order_ as order_0_, proxyset0_.next_ as next_0_, proxyset0_.X as X0_, proxyset0_.Immutable as Immutable0_, proxyset0_.[any_id of object] as y10_0_, proxyset0_.[any_class of object] as y11_0_, proxyset0_.namecvbnmasdf as namecvbn3_0_, proxyset0_.version as version0_, proxyset0_.foo as foo0_, proxyset0_.bar as bar0_ FROM [glarchez] proxyset0_ WHERE proxyset0_.set_key=@p0
2006-03-20 23:08:17,305 [876] DEBUG NHibernate.SQL - @p0 = '988219dd25914eb38beff11669cb9a5f'
2006-03-20 23:08:17,383 [876] DEBUG NHibernate.SQL - SELECT strings0_.glarch_key as glarch_key__, strings0_.[tha_stryng] as y2___, strings0_.[!@# i] as y3___ FROM Strings strings0_ WHERE strings0_.glarch_key=@p0
2006-03-20 23:08:17,383 [876] DEBUG NHibernate.SQL - @p0 = '988219dd25914eb38beff11669cb9a5f'
2006-03-20 23:08:17,383 [876] DEBUG NHibernate.SQL - SELECT foocompone0_.glarch_key as glarch_key__, foocompone0_.name_ as name___, foocompone0_.count_ as count___, foocompone0_.x_ as x___, foocompone0_.y_ as y___, foocompone0_.Fee as Fee__, foocompone0_.tha_indecks as tha_inde7___, fee1_.id_ as id_0_, fee1_.AnotherFee as AnotherFee0_, fee1_.Fi as Fi0_, fee1_.TheFee as TheFee0_, fee1_.Name as Name0_, fee1_.null_prop as null_prop0_, fee1_.Qux as Qux0_, fee1_.count_ as count_0_, fee2_.id_ as id_1_, fee2_.AnotherFee as AnotherFee1_, fee2_.Fi as Fi1_, fee2_.TheFee as TheFee1_, fee2_.Name as Name1_, fee2_.null_prop as null_prop1_, fee2_.Qux as Qux1_, fee2_.count_ as count_1_ FROM FooComponents foocompone0_ left outer join [the fees] fee1_ on foocompone0_.Fee=fee1_.id_ left outer join [the fees] fee2_ on fee1_.AnotherFee=fee2_.id_ WHERE foocompone0_.glarch_key=@p0
2006-03-20 23:08:17,383 [876] DEBUG NHibernate.SQL - @p0 = '988219dd25914eb38beff11669cb9a5f'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - SELECT glarch0_.tha_key as tha_key0_, glarch0_.count_ as count_0_, glarch0_.glarch_ as glarch_0_, glarch0_.order_ as order_0_, glarch0_.next_ as next_0_, glarch0_.X as X0_, glarch0_.Immutable as Immutable0_, glarch0_.[any_id of object] as y10_0_, glarch0_.[any_class of object] as y11_0_, glarch0_.namecvbnmasdf as namecvbn3_0_, glarch0_.version as version0_, glarch0_.foo as foo0_, glarch0_.bar as bar0_ FROM [glarchez] glarch0_ WHERE glarch0_.tha_key=@p0
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p0 = '9effd15ffd22450b9872f3ac014b7ed1'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - SELECT proxyarray0_.array_key as array_key__, proxyarray0_.tha_key as tha_key__, proxyarray0_.array_indecks as array_i21___, proxyarray0_.tha_key as tha_key0_, proxyarray0_.count_ as count_0_, proxyarray0_.glarch_ as glarch_0_, proxyarray0_.order_ as order_0_, proxyarray0_.next_ as next_0_, proxyarray0_.X as X0_, proxyarray0_.Immutable as Immutable0_, proxyarray0_.[any_id of object] as y10_0_, proxyarray0_.[any_class of object] as y11_0_, proxyarray0_.namecvbnmasdf as namecvbn3_0_, proxyarray0_.version as version0_, proxyarray0_.foo as foo0_, proxyarray0_.bar as bar0_ FROM [glarchez] proxyarray0_ WHERE proxyarray0_.array_key=@p0
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p0 = '9effd15ffd22450b9872f3ac014b7ed1'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - SELECT proxyset0_.set_key as set_key__, proxyset0_.tha_key as tha_key__, proxyset0_.tha_key as tha_key0_, proxyset0_.count_ as count_0_, proxyset0_.glarch_ as glarch_0_, proxyset0_.order_ as order_0_, proxyset0_.next_ as next_0_, proxyset0_.X as X0_, proxyset0_.Immutable as Immutable0_, proxyset0_.[any_id of object] as y10_0_, proxyset0_.[any_class of object] as y11_0_, proxyset0_.namecvbnmasdf as namecvbn3_0_, proxyset0_.version as version0_, proxyset0_.foo as foo0_, proxyset0_.bar as bar0_ FROM [glarchez] proxyset0_ WHERE proxyset0_.set_key=@p0
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p0 = '9effd15ffd22450b9872f3ac014b7ed1'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - SELECT strings0_.glarch_key as glarch_key__, strings0_.[tha_stryng] as y2___, strings0_.[!@# i] as y3___ FROM Strings strings0_ WHERE strings0_.glarch_key=@p0
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p0 = '9effd15ffd22450b9872f3ac014b7ed1'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - SELECT foocompone0_.glarch_key as glarch_key__, foocompone0_.name_ as name___, foocompone0_.count_ as count___, foocompone0_.x_ as x___, foocompone0_.y_ as y___, foocompone0_.Fee as Fee__, foocompone0_.tha_indecks as tha_inde7___, fee1_.id_ as id_0_, fee1_.AnotherFee as AnotherFee0_, fee1_.Fi as Fi0_, fee1_.TheFee as TheFee0_, fee1_.Name as Name0_, fee1_.null_prop as null_prop0_, fee1_.Qux as Qux0_, fee1_.count_ as count_0_, fee2_.id_ as id_1_, fee2_.AnotherFee as AnotherFee1_, fee2_.Fi as Fi1_, fee2_.TheFee as TheFee1_, fee2_.Name as Name1_, fee2_.null_prop as null_prop1_, fee2_.Qux as Qux1_, fee2_.count_ as count_1_ FROM FooComponents foocompone0_ left outer join [the fees] fee1_ on foocompone0_.Fee=fee1_.id_ left outer join [the fees] fee2_ on fee1_.AnotherFee=fee2_.id_ WHERE foocompone0_.glarch_key=@p0
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p0 = '9effd15ffd22450b9872f3ac014b7ed1'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - UPDATE [foos] SET foo = @p0, Version = @p1 WHERE [foo_id] = @p2 AND Version = @p3
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p0 = ''
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p1 = '1'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p2 = '1fbd515f7ecb4d82be20bed7be52ba78'
2006-03-20 23:08:17,399 [876] DEBUG NHibernate.SQL - @p3 = '1'
2006-03-20 23:08:17,445 [876] DEBUG NHibernate.Cache.NonstrictReadWriteCache - Invalidating: 1fbd515f7ecb4d82be20bed7be52ba78
---> remainder of log cut
_________________ Mike Abraham
|