You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(110) |
Nov
(296) |
Dec
(107) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(212) |
Feb
(263) |
Mar
(161) |
Apr
(183) |
May
(183) |
Jun
(75) |
Jul
(106) |
Aug
(88) |
Sep
(227) |
Oct
(143) |
Nov
(154) |
Dec
(53) |
2008 |
Jan
(77) |
Feb
|
Mar
|
Apr
(6) |
May
(103) |
Jun
(296) |
Jul
(54) |
Aug
|
Sep
(379) |
Oct
(283) |
Nov
(224) |
Dec
(214) |
2009 |
Jan
(129) |
Feb
(257) |
Mar
(136) |
Apr
(12) |
May
(329) |
Jun
(434) |
Jul
(375) |
Aug
(171) |
Sep
|
Oct
|
Nov
|
Dec
(54) |
2010 |
Jan
(198) |
Feb
(76) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(62) |
Jul
(210) |
Aug
(447) |
Sep
(330) |
Oct
(257) |
Nov
(133) |
Dec
(453) |
2011 |
Jan
(240) |
Feb
(128) |
Mar
(442) |
Apr
(320) |
May
(428) |
Jun
(141) |
Jul
(13) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 18:33:59
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2700: ---------------------------- Affects Version/s: (was: 3.2.0Alpha3) (was: 3.2.0Alpha2) (was: 3.2.0Alpha1) (was: 3.0.0.GA) (was: 3.0.0.CR1) (was: 3.0.0.Beta2) (was: 3.0.0.Beta1) (was: 3.0.0.Alpha3) (was: 3.0.0.Alpha2) (was: 3.0.0.Alpha1) > SqlFunctionProjection does not honor parameter order > ---------------------------------------------------- > > Key: NH-2700 > URL: http://216.121.112.228/browse/NH-2700 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Andrei Alecu > Priority: Minor > Attachments: nh2700 failing test.patch > > > If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order. > For example: > RegisterFunction( > "AddDays", > new SQLFunctionTemplate( > NHibernateUtil.DateTime, > "dateadd(day,?2,?1)" > > ) > ); > var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime, > new IProjection[] > { > Projections.Property<ModelClass>(p=>p.Date1), > Projections.Property<ModelClass>(p=>p.Value1) > }); > Generated SQL (buggy): > SELECT dateadd(day,this_.Date1,this_.Value1) > Expected SQL: > SELECT dateadd(day,this_.Value1,this_.Date1) > Using an HQL query honors parameter order properly > I will attach a failing unit test. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 18:33:57
|
[ http://216.121.112.228/browse/NH-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2691. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 > Linq LongCount() behavior different from Count() > ------------------------------------------------ > > Key: NH-2691 > URL: http://216.121.112.228/browse/NH-2691 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Minor > Fix For: 3.2.0Beta1 > > > It seems to me that Count() and LongCount() should behave the same, except for the max value they return. I am finding this not to be the case. Consider the following example: > var query = > from cat in session.Query<Cat>() > orderby cat.Born > select cat; > var queryCount = query.Count(); > // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ > var queryLongCount = query.LongCount(); > // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ order by cat0_.Born > I am partial to the behavior of .Count() where it ignores the order. Also, it seems that LongCount() should probably cast as a long, instead of an int. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-12 18:20:56
|
[ http://216.121.112.228/browse/NH-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrei Alecu updated NH-2700: ----------------------------- Attachment: nh2700 failing test.patch Failing test attached. > SqlFunctionProjection does not honor parameter order > ---------------------------------------------------- > > Key: NH-2700 > URL: http://216.121.112.228/browse/NH-2700 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha1, 3.0.0.Alpha2, 3.0.0.Alpha3, 3.0.0.Beta1, 3.0.0.Beta2, 3.0.0.CR1, 3.0.0.GA, 3.1.0, 3.2.0Alpha1, 3.2.0Alpha2, 3.2.0Alpha3 > Reporter: Andrei Alecu > Priority: Minor > Attachments: nh2700 failing test.patch > > > If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order. > For example: > RegisterFunction( > "AddDays", > new SQLFunctionTemplate( > NHibernateUtil.DateTime, > "dateadd(day,?2,?1)" > > ) > ); > var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime, > new IProjection[] > { > Projections.Property<ModelClass>(p=>p.Date1), > Projections.Property<ModelClass>(p=>p.Value1) > }); > Generated SQL (buggy): > SELECT dateadd(day,this_.Date1,this_.Value1) > Expected SQL: > SELECT dateadd(day,this_.Value1,this_.Date1) > Using an HQL query honors parameter order properly > I will attach a failing unit test. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-12 18:17:53
|
SqlFunctionProjection does not honor parameter order ---------------------------------------------------- Key: NH-2700 URL: http://216.121.112.228/browse/NH-2700 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.2.0Alpha3, 3.2.0Alpha2, 3.2.0Alpha1, 3.1.0, 3.0.0.GA, 3.0.0.CR1, 3.0.0.Beta2, 3.0.0.Beta1, 3.0.0.Alpha3, 3.0.0.Alpha2, 3.0.0.Alpha1 Reporter: Andrei Alecu Priority: Minor If you define a function in a custom dialect that does not have the parameters in order and use SqlFunctionProjection, the generated sql is wrong, and does not honor parameter order. For example: RegisterFunction( "AddDays", new SQLFunctionTemplate( NHibernateUtil.DateTime, "dateadd(day,?2,?1)" ) ); var proj = new SqlFunctionProjection("AddDays", NHibernateUtil.DateTime, new IProjection[] { Projections.Property<ModelClass>(p=>p.Date1), Projections.Property<ModelClass>(p=>p.Value1) }); Generated SQL (buggy): SELECT dateadd(day,this_.Date1,this_.Value1) Expected SQL: SELECT dateadd(day,this_.Value1,this_.Date1) Using an HQL query honors parameter order properly I will attach a failing unit test. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Kelly S. (JIRA) <nh...@gm...> - 2011-05-12 17:49:10
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21063#action_21063 ] Kelly Stuard commented on NH-2690: ---------------------------------- Big thanks to all who touched this. This allows for all sorts of performance improvements. > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Assignee: Fabio Maulo > Priority: Major > Fix For: 3.2.0Beta1 > > Attachments: nh2690 nh2422 nh2421.patch, NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:43:03
|
[ http://216.121.112.228/browse/NH-2699?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2699. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 > Sql Azure dialect > ----------------- > > Key: NH-2699 > URL: http://216.121.112.228/browse/NH-2699 > Project: NHibernate > Issue Type: New Feature > Components: DataProviders / Dialects > Affects Versions: 3.1.0 > Reporter: Fabio Maulo > Fix For: 3.2.0Beta1 > > > Specific dialect for Microsoft SQL Azure -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:42:57
|
Sql Azure dialect ----------------- Key: NH-2699 URL: http://216.121.112.228/browse/NH-2699 Project: NHibernate Issue Type: New Feature Components: DataProviders / Dialects Affects Versions: 3.1.0 Reporter: Fabio Maulo Specific dialect for Microsoft SQL Azure -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:28:19
|
[ http://216.121.112.228/browse/NH-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2422. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 > ToFuture throws NotSupportedException on IQueryable if Fetch is used. > --------------------------------------------------------------------- > > Key: NH-2422 > URL: http://216.121.112.228/browse/NH-2422 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.CR1 > Reporter: Michael Hart > Priority: Major > Fix For: 3.2.0Beta1 > > > If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase. > ie, this works: > var result = ses.Query<Child>() > .ToFuture(); > But this throws a NotSupportedException: > var result = ses.Query<Child>() > .Fetch(x => x.Parent) > .ToFuture(); > This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary. > It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten. > I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:28:04
|
[ http://216.121.112.228/browse/NH-2421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2421. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 > NotSupportedException text in ToFuture and ToFutureValue does not make sense (or help) > -------------------------------------------------------------------------------------- > > Key: NH-2421 > URL: http://216.121.112.228/browse/NH-2421 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.CR1 > Reporter: Michael Hart > Priority: Minor > Fix For: 3.2.0Beta1 > > > Current text of the exception thrown is "You can also use the AsFuture() method on NhQueryable". > This exception is thrown if the type is *not* an NhQueryable already, so it actually doesn't make sense - or at least, if it does make a little sense, it certainly doesn't help the user. > This exception is thrown for example if you try to call ToFuture after a Fetch. > var result = ses.Query<Child>() > .Fetch(x => x.Parent) > .ToFuture(); > I believe the exception should say something along the lines of: "You can only use the ToFuture() method on an NhQueryable". -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:27:56
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2690. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Beta1 > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Assignee: Fabio Maulo > Priority: Major > Fix For: 3.2.0Beta1 > > Attachments: nh2690 nh2422 nh2421.patch, NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-12 16:21:42
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo reassigned NH-2690: ------------------------------- Assignee: Fabio Maulo > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Assignee: Fabio Maulo > Priority: Major > Attachments: nh2690 nh2422 nh2421.patch, NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Kelly S. (JIRA) <nh...@gm...> - 2011-05-12 14:53:14
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21062#action_21062 ] Kelly Stuard commented on NH-2690: ---------------------------------- That is a very small change with such wonderful impact. Here'e to hoping it's easy to review and get into the trunk. Thank you, Andrei. > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Major > Attachments: nh2690 nh2422 nh2421.patch, NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Filip K. (JIRA) <nh...@gm...> - 2011-05-11 17:24:04
|
[ http://216.121.112.228/browse/NH-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21061#action_21061 ] Filip Kinsky commented on NH-2596: ---------------------------------- fully working IFlushEntityEventListener can be found here: https://github.com/Buthrakaur/NHListenerTests/blob/master/NHListenerTest/SetModificationTimeFlushEntityEventListener.cs > changes made in IPreInsert/UpdateEventListener are not persisted into DB on inherited classes > --------------------------------------------------------------------------------------------- > > Key: NH-2596 > URL: http://216.121.112.228/browse/NH-2596 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha3 > Reporter: Filip Kinsky > Priority: Major > Attachments: NHListenerTest.zip, NHListenerTest_NH31.zip > > > We're logging modification date in few of our persisted classes using simple > interface and basic IPreInsert/UpdateEventListener implementation which uses > this code to set LastModified field: > var trackable = entity as ITrackModificationDate; > if (trackable != null) > { > trackable.LastModified = DateTime.Now; > persister.SetPropertyValue(state, "LastModified", trackable.LastModified); > } > This works for basic classes without any inheritance hierarchy, but when I > map inherited classes (LastModified field implemented by the hierarchy > root) and update some property which exists just in the inherited class, the > listener is triggered, but the modified LastModified property value is not > being persisted into database. I isolated the problem and implemented > attached failing test, but I'm not able to figure out what should I do in > the listener to force NH to update the DB properly. > Test classes: > public class Thing : ITrackModificationDate > { > public virtual long Id { get; set; } > public virtual DateTime LastModified { get; set; } > } > public class InheritedThing: Thing > { > public virtual string SomeText { get; set; } > } > public class ThingMap : ClassMap<Thing> > { > public ThingMap() > { > Id(x => x.Id).GeneratedBy.Assigned(); > Map(x => x.LastModified); > } > } > public class InheritedThingMap: SubclassMap<InheritedThing> > { > public InheritedThingMap() > { > Map(x => x.SomeText); > } > } > Failing test: > [Fact] > public void InheritedThing_LastModified_Should_BeSetOnUpdate() > { > var t = new InheritedThing {Id = 1, SomeText = "aa"}; > session.Save(t); > session.Flush(); > session.Clear(); > > Thread.Sleep(1000); > t = session.Get<InheritedThing>(1L); > t.SomeText = "bb"; > session.Update(t); > session.Flush(); > session.Clear(); > > t = session.Get<InheritedThing>(1L); > Assert.True(DateTime.Now.Subtract(t.LastModified).TotalSeconds < 1); //this fails - LastModified property isn't updated in DB > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 15:43:58
|
[ http://216.121.112.228/browse/NH-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21060#action_21060 ] Andrei Alecu commented on NH-2691: ---------------------------------- SQLite only has INTEGER, which can be up to 64 bits, so the cast is correct here for the SQLite dialect. What seems wrong is the order clause though. You might want to check if the cast is correct for some other dialect that treats has separate types for 64 bit integers. (maybe SQL Express) > Linq LongCount() behavior different from Count() > ------------------------------------------------ > > Key: NH-2691 > URL: http://216.121.112.228/browse/NH-2691 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Minor > > It seems to me that Count() and LongCount() should behave the same, except for the max value they return. I am finding this not to be the case. Consider the following example: > var query = > from cat in session.Query<Cat>() > orderby cat.Born > select cat; > var queryCount = query.Count(); > // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ > var queryLongCount = query.LongCount(); > // NHibernate: select cast(count(*) as INTEGER) as col_0_0_ from Cat cat0_ order by cat0_.Born > I am partial to the behavior of .Count() where it ignores the order. Also, it seems that LongCount() should probably cast as a long, instead of an int. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 14:42:58
|
[ http://216.121.112.228/browse/NH-2689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21059#action_21059 ] Andrei Alecu commented on NH-2689: ---------------------------------- Instead of query.Where(x=>expression(x)) try just query.Where(expression) and see if you still get that error. x=>expression(x) will re-wrap the original expression into something else, hence your error. > Where clause error > ------------------ > > Key: NH-2689 > URL: http://216.121.112.228/browse/NH-2689 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Alexander Kozlenko > Priority: Blocker > Attachments: nh-v3.1.0.4000-bug-1.txt > > > Have a query as "query.Where(x => expression(x)).ToList()" where "expression" is "LambdaExpression.Lambda(Expression.IsTrue(...), ...)" which trows this exception on data fetch. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Filip K. (JIRA) <nh...@gm...> - 2011-05-11 14:20:43
|
[ http://216.121.112.228/browse/NH-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21058#action_21058 ] Filip Kinsky commented on NH-2596: ---------------------------------- I see - you're right... > changes made in IPreInsert/UpdateEventListener are not persisted into DB on inherited classes > --------------------------------------------------------------------------------------------- > > Key: NH-2596 > URL: http://216.121.112.228/browse/NH-2596 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha3 > Reporter: Filip Kinsky > Priority: Major > Attachments: NHListenerTest.zip, NHListenerTest_NH31.zip > > > We're logging modification date in few of our persisted classes using simple > interface and basic IPreInsert/UpdateEventListener implementation which uses > this code to set LastModified field: > var trackable = entity as ITrackModificationDate; > if (trackable != null) > { > trackable.LastModified = DateTime.Now; > persister.SetPropertyValue(state, "LastModified", trackable.LastModified); > } > This works for basic classes without any inheritance hierarchy, but when I > map inherited classes (LastModified field implemented by the hierarchy > root) and update some property which exists just in the inherited class, the > listener is triggered, but the modified LastModified property value is not > being persisted into database. I isolated the problem and implemented > attached failing test, but I'm not able to figure out what should I do in > the listener to force NH to update the DB properly. > Test classes: > public class Thing : ITrackModificationDate > { > public virtual long Id { get; set; } > public virtual DateTime LastModified { get; set; } > } > public class InheritedThing: Thing > { > public virtual string SomeText { get; set; } > } > public class ThingMap : ClassMap<Thing> > { > public ThingMap() > { > Id(x => x.Id).GeneratedBy.Assigned(); > Map(x => x.LastModified); > } > } > public class InheritedThingMap: SubclassMap<InheritedThing> > { > public InheritedThingMap() > { > Map(x => x.SomeText); > } > } > Failing test: > [Fact] > public void InheritedThing_LastModified_Should_BeSetOnUpdate() > { > var t = new InheritedThing {Id = 1, SomeText = "aa"}; > session.Save(t); > session.Flush(); > session.Clear(); > > Thread.Sleep(1000); > t = session.Get<InheritedThing>(1L); > t.SomeText = "bb"; > session.Update(t); > session.Flush(); > session.Clear(); > > t = session.Get<InheritedThing>(1L); > Assert.True(DateTime.Now.Subtract(t.LastModified).TotalSeconds < 1); //this fails - LastModified property isn't updated in DB > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-11 14:12:05
|
[ http://216.121.112.228/browse/NH-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21057#action_21057 ] Fabio Maulo commented on NH-2596: --------------------------------- 1) your IFlushEntityEventListener inherits from default. Have you a special reason ? 2) where is the line I have sent you? you are appending after default listener I'm inserting before. btw, If you want an example send me the code as attach in a private mail, then I will use your domain to write a public example. > changes made in IPreInsert/UpdateEventListener are not persisted into DB on inherited classes > --------------------------------------------------------------------------------------------- > > Key: NH-2596 > URL: http://216.121.112.228/browse/NH-2596 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha3 > Reporter: Filip Kinsky > Priority: Major > Attachments: NHListenerTest.zip, NHListenerTest_NH31.zip > > > We're logging modification date in few of our persisted classes using simple > interface and basic IPreInsert/UpdateEventListener implementation which uses > this code to set LastModified field: > var trackable = entity as ITrackModificationDate; > if (trackable != null) > { > trackable.LastModified = DateTime.Now; > persister.SetPropertyValue(state, "LastModified", trackable.LastModified); > } > This works for basic classes without any inheritance hierarchy, but when I > map inherited classes (LastModified field implemented by the hierarchy > root) and update some property which exists just in the inherited class, the > listener is triggered, but the modified LastModified property value is not > being persisted into database. I isolated the problem and implemented > attached failing test, but I'm not able to figure out what should I do in > the listener to force NH to update the DB properly. > Test classes: > public class Thing : ITrackModificationDate > { > public virtual long Id { get; set; } > public virtual DateTime LastModified { get; set; } > } > public class InheritedThing: Thing > { > public virtual string SomeText { get; set; } > } > public class ThingMap : ClassMap<Thing> > { > public ThingMap() > { > Id(x => x.Id).GeneratedBy.Assigned(); > Map(x => x.LastModified); > } > } > public class InheritedThingMap: SubclassMap<InheritedThing> > { > public InheritedThingMap() > { > Map(x => x.SomeText); > } > } > Failing test: > [Fact] > public void InheritedThing_LastModified_Should_BeSetOnUpdate() > { > var t = new InheritedThing {Id = 1, SomeText = "aa"}; > session.Save(t); > session.Flush(); > session.Clear(); > > Thread.Sleep(1000); > t = session.Get<InheritedThing>(1L); > t.SomeText = "bb"; > session.Update(t); > session.Flush(); > session.Clear(); > > t = session.Get<InheritedThing>(1L); > Assert.True(DateTime.Now.Subtract(t.LastModified).TotalSeconds < 1); //this fails - LastModified property isn't updated in DB > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 14:07:53
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrei Alecu updated NH-2690: ----------------------------- Attachment: nh2690 nh2422 nh2421.patch Attached patch which resolves NH-2690 NH-2421 and NH-2422 > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Major > Attachments: nh2690 nh2422 nh2421.patch, NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Filip K. (JIRA) <nh...@gm...> - 2011-05-11 13:53:02
|
[ http://216.121.112.228/browse/NH-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21055#action_21055 ] Filip Kinsky commented on NH-2596: ---------------------------------- sorry Fabio, but I don't understand what do you mean by this comment - I registered the listener in the same manner as you can see from this code: https://github.com/Buthrakaur/NHListenerTests/blob/master/NHListenerTest/SetModificationTimeSaveOrUpdateEventListener.cs#L110 > changes made in IPreInsert/UpdateEventListener are not persisted into DB on inherited classes > --------------------------------------------------------------------------------------------- > > Key: NH-2596 > URL: http://216.121.112.228/browse/NH-2596 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha3 > Reporter: Filip Kinsky > Priority: Major > Attachments: NHListenerTest.zip, NHListenerTest_NH31.zip > > > We're logging modification date in few of our persisted classes using simple > interface and basic IPreInsert/UpdateEventListener implementation which uses > this code to set LastModified field: > var trackable = entity as ITrackModificationDate; > if (trackable != null) > { > trackable.LastModified = DateTime.Now; > persister.SetPropertyValue(state, "LastModified", trackable.LastModified); > } > This works for basic classes without any inheritance hierarchy, but when I > map inherited classes (LastModified field implemented by the hierarchy > root) and update some property which exists just in the inherited class, the > listener is triggered, but the modified LastModified property value is not > being persisted into database. I isolated the problem and implemented > attached failing test, but I'm not able to figure out what should I do in > the listener to force NH to update the DB properly. > Test classes: > public class Thing : ITrackModificationDate > { > public virtual long Id { get; set; } > public virtual DateTime LastModified { get; set; } > } > public class InheritedThing: Thing > { > public virtual string SomeText { get; set; } > } > public class ThingMap : ClassMap<Thing> > { > public ThingMap() > { > Id(x => x.Id).GeneratedBy.Assigned(); > Map(x => x.LastModified); > } > } > public class InheritedThingMap: SubclassMap<InheritedThing> > { > public InheritedThingMap() > { > Map(x => x.SomeText); > } > } > Failing test: > [Fact] > public void InheritedThing_LastModified_Should_BeSetOnUpdate() > { > var t = new InheritedThing {Id = 1, SomeText = "aa"}; > session.Save(t); > session.Flush(); > session.Clear(); > > Thread.Sleep(1000); > t = session.Get<InheritedThing>(1L); > t.SomeText = "bb"; > session.Update(t); > session.Flush(); > session.Clear(); > > t = session.Get<InheritedThing>(1L); > Assert.True(DateTime.Now.Subtract(t.LastModified).TotalSeconds < 1); //this fails - LastModified property isn't updated in DB > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Fabio M. (JIRA) <nh...@gm...> - 2011-05-11 13:45:06
|
[ http://216.121.112.228/browse/NH-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21054#action_21054 ] Fabio Maulo commented on NH-2596: --------------------------------- The register line is cfg.EventListeners.FlushEntityEventListeners = new[] { listener }.Concat(cfg.EventListeners.FlushEntityEventListeners).ToArray(); > changes made in IPreInsert/UpdateEventListener are not persisted into DB on inherited classes > --------------------------------------------------------------------------------------------- > > Key: NH-2596 > URL: http://216.121.112.228/browse/NH-2596 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha3 > Reporter: Filip Kinsky > Priority: Major > Attachments: NHListenerTest.zip, NHListenerTest_NH31.zip > > > We're logging modification date in few of our persisted classes using simple > interface and basic IPreInsert/UpdateEventListener implementation which uses > this code to set LastModified field: > var trackable = entity as ITrackModificationDate; > if (trackable != null) > { > trackable.LastModified = DateTime.Now; > persister.SetPropertyValue(state, "LastModified", trackable.LastModified); > } > This works for basic classes without any inheritance hierarchy, but when I > map inherited classes (LastModified field implemented by the hierarchy > root) and update some property which exists just in the inherited class, the > listener is triggered, but the modified LastModified property value is not > being persisted into database. I isolated the problem and implemented > attached failing test, but I'm not able to figure out what should I do in > the listener to force NH to update the DB properly. > Test classes: > public class Thing : ITrackModificationDate > { > public virtual long Id { get; set; } > public virtual DateTime LastModified { get; set; } > } > public class InheritedThing: Thing > { > public virtual string SomeText { get; set; } > } > public class ThingMap : ClassMap<Thing> > { > public ThingMap() > { > Id(x => x.Id).GeneratedBy.Assigned(); > Map(x => x.LastModified); > } > } > public class InheritedThingMap: SubclassMap<InheritedThing> > { > public InheritedThingMap() > { > Map(x => x.SomeText); > } > } > Failing test: > [Fact] > public void InheritedThing_LastModified_Should_BeSetOnUpdate() > { > var t = new InheritedThing {Id = 1, SomeText = "aa"}; > session.Save(t); > session.Flush(); > session.Clear(); > > Thread.Sleep(1000); > t = session.Get<InheritedThing>(1L); > t.SomeText = "bb"; > session.Update(t); > session.Flush(); > session.Clear(); > > t = session.Get<InheritedThing>(1L); > Assert.True(DateTime.Now.Subtract(t.LastModified).TotalSeconds < 1); //this fails - LastModified property isn't updated in DB > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Steve B. (JIRA) <nh...@gm...> - 2011-05-11 13:32:02
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21053#action_21053 ] Steve Bohlen commented on NH-2690: ---------------------------------- Applying your changes to the trunk in order to create a patch isn't that hard -- just do the following and you should be fine: 1) checkout source from SVN into a completely new folder location 2) copy the entire source tree in which you made your edits to the clipboard 3) paste it into the checked-out folder hierarchy, selecting OVERWRITE/REPLACE as the method to resolve file/folder conflicts 4) build your patch based on the resultant source (after you verify that it still all builds/tests pass of course) Step #3 will properly integrate your changes into the checked-out source from SVN. Let us know if you have any troubles with this approach. > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Major > Attachments: NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 13:24:03
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21052#action_21052 ] Andrei Alecu commented on NH-2690: ---------------------------------- Ok, I had a little bit of free time on my hands so I grabbed the NHibernate source and was able to fix both bugs (NH-2690 and NH-2422). I added a bunch of tests and verified that all other tests still pass. I will submit a patch soon. (unfortunately I didn't grab the source via SVN initially so getting the .patch file out is going to be a pain) > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Major > Attachments: NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Filip K. (JIRA) <nh...@gm...> - 2011-05-11 12:03:08
|
[ http://216.121.112.228/browse/NH-2596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21051#action_21051 ] Filip Kinsky commented on NH-2596: ---------------------------------- continuation of this issue: https://groups.google.com/d/topic/nhusers/0kugoXFPeGw/discussion > changes made in IPreInsert/UpdateEventListener are not persisted into DB on inherited classes > --------------------------------------------------------------------------------------------- > > Key: NH-2596 > URL: http://216.121.112.228/browse/NH-2596 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.0.0.Alpha3 > Reporter: Filip Kinsky > Priority: Major > Attachments: NHListenerTest.zip, NHListenerTest_NH31.zip > > > We're logging modification date in few of our persisted classes using simple > interface and basic IPreInsert/UpdateEventListener implementation which uses > this code to set LastModified field: > var trackable = entity as ITrackModificationDate; > if (trackable != null) > { > trackable.LastModified = DateTime.Now; > persister.SetPropertyValue(state, "LastModified", trackable.LastModified); > } > This works for basic classes without any inheritance hierarchy, but when I > map inherited classes (LastModified field implemented by the hierarchy > root) and update some property which exists just in the inherited class, the > listener is triggered, but the modified LastModified property value is not > being persisted into database. I isolated the problem and implemented > attached failing test, but I'm not able to figure out what should I do in > the listener to force NH to update the DB properly. > Test classes: > public class Thing : ITrackModificationDate > { > public virtual long Id { get; set; } > public virtual DateTime LastModified { get; set; } > } > public class InheritedThing: Thing > { > public virtual string SomeText { get; set; } > } > public class ThingMap : ClassMap<Thing> > { > public ThingMap() > { > Id(x => x.Id).GeneratedBy.Assigned(); > Map(x => x.LastModified); > } > } > public class InheritedThingMap: SubclassMap<InheritedThing> > { > public InheritedThingMap() > { > Map(x => x.SomeText); > } > } > Failing test: > [Fact] > public void InheritedThing_LastModified_Should_BeSetOnUpdate() > { > var t = new InheritedThing {Id = 1, SomeText = "aa"}; > session.Save(t); > session.Flush(); > session.Clear(); > > Thread.Sleep(1000); > t = session.Get<InheritedThing>(1L); > t.SomeText = "bb"; > session.Update(t); > session.Flush(); > session.Clear(); > > t = session.Get<InheritedThing>(1L); > Assert.True(DateTime.Now.Subtract(t.LastModified).TotalSeconds < 1); //this fails - LastModified property isn't updated in DB > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 11:13:03
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21050#action_21050 ] Andrei Alecu commented on NH-2690: ---------------------------------- Also, something else to test would be to try multiple calls to ToFuture() instead of just one. I believe this escalates to a MultiQuery and might result in the same error, even if you're selecting to Cat. Something like: var cat1 = Session.Query<Cat>().Where(p=>p.Id = 1).ToFuture(); var cat2 = Session.Query<Cat>().Where(p=>p.Id = 2).ToFuture(); var cats = cat1.Concat(cat2).ToList(); > Linq Select() broken with .ToFuture() > ------------------------------------- > > Key: NH-2690 > URL: http://216.121.112.228/browse/NH-2690 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Kelly Stuard > Priority: Major > Attachments: NH2690.zip > > > //Given the following: > var query = > from cat in session.Query<Cat>() > select new > { > Id = cat.Id, > Name = cat.Name, > }; > //This works: > var result1 = query.ToList(); > //But this does not: > var queryResults = query.ToFuture().ToList(); > Exception: > NHibernate.HibernateException was unhandled > Message=Failed to execute multi query: [select cat0_.Id as col_0_0_, cat0_.Name as col_1_0_ from Cat cat0_; > ] > Source=NHibernate > StackTrace: > at NHibernate.Impl.MultiQueryImpl.DoList() > at NHibernate.Impl.MultiQueryImpl.ListIgnoreQueryCache() > at NHibernate.Impl.MultiQueryImpl.List() > at NHibernate.Impl.FutureQueryBatch.GetResultsFrom(IMultiQuery multiApproach) > at NHibernate.Impl.FutureBatch`2.GetResults() > at NHibernate.Impl.FutureBatch`2.get_Results() > at NHibernate.Impl.FutureBatch`2.GetCurrentResult[TResult](Int32 currentIndex) > at NHibernate.Impl.FutureBatch`2.<>c__DisplayClass4`1.<GetEnumerator>b__3() > at NHibernate.Impl.DelayedEnumerator`1.<get_Enumerable>d__0.MoveNext() > at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) > at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) > at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.ShouldBeAbleToFutureSelectOntoAnonymous() in C:\Users\kstuard\Desktop\NH2540\NHibernate.Test\NHSpecificTest\NH1234\SampleTest.cs:line 97 > at ConsoleApplication2.Program.Main(String[] args) in C:\Users\kstuard\Desktop\NH2540\ConsoleApplication2\Program.cs:line 16 > at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) > at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx) > at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > InnerException: System.ArgumentException > Message=The value "System.Object[]" is not of type "<>f__AnonymousType0`2[System.Int32,System.String]" and cannot be used in this generic collection. > Parameter name: value > Source=mscorlib > ParamName=value > StackTrace: > at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType) > at System.Collections.Generic.List`1.System.Collections.IList.Add(Object item) > at NHibernate.Impl.MultiQueryImpl.DoList() > InnerException: > This works fine if I select directly to typeof(Cat). Future is such a wonderful tool; it would be great if it worked in this scenario. > I will attach test cases used to generate this exception, shortly. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Andrei A. (JIRA) <nh...@gm...> - 2011-05-11 11:01:04
|
[ http://216.121.112.228/browse/NH-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21049#action_21049 ] Andrei Alecu commented on NH-2422: ---------------------------------- Also see NH-2690 which I believe is related as the cast to QueryableBase<T> results in a different error that occurs under other circumstances. > ToFuture throws NotSupportedException on IQueryable if Fetch is used. > --------------------------------------------------------------------- > > Key: NH-2422 > URL: http://216.121.112.228/browse/NH-2422 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.CR1 > Reporter: Michael Hart > Priority: Major > > If a Fetch call is added to an NHibernate LINQ query, a NotSupportedException is thrown as the type is no longer an NhQueryable but rather an NhFetchRequest - however, both types extend QueryableBase. > ie, this works: > var result = ses.Query<Child>() > .ToFuture(); > But this throws a NotSupportedException: > var result = ses.Query<Child>() > .Fetch(x => x.Parent) > .ToFuture(); > This makes the ToFuture and ToFutureValue methods of limited use in a production system where eager fetching is necessary. > It also reduces the flexibility to modify queries from being lazy loading (or whatever the default is), to adding eager loading later. If an application has been written using futures and lazy loading, then it is non-trivial to add eager fetching as any futures semantics and logic must also be rewritten. > I believe ToFuture should be modified to test and cast the query as a QueryableBase instead of an NhQueryable. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |