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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-04 21:05:03
|
[ http://216.121.112.228/browse/NH-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20997#action_20997 ] Kelly Stuard commented on NH-2691: ---------------------------------- If anyone knows how to create tests that are specific to "long", I would love to have your input. Creating int.MaxValue+1 of Cats takes an extremely long time; even in SQLite. As such, I cannot make any failing tests of this issue and am requesting guidance. > 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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-04 21:02:56
|
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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-04 18:56:54
|
[ http://216.121.112.228/browse/NH-2690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kelly Stuard updated NH-2690: ----------------------------- Attachment: NH2690.zip This is my first test case. I believe I followed the directions, correctly. Please let me know if I missed something or if I can provide additional information. > 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: Kelly S. (JIRA) <nh...@gm...> - 2011-05-04 18:49:56
|
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 //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: Alexander K. (JIRA) <nh...@gm...> - 2011-05-04 14:46:54
|
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: Ricardo P. (JIRA) <nh...@gm...> - 2011-05-04 11:30:01
|
[ http://216.121.112.228/browse/NH-2687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20995#action_20995 ] Ricardo Peres commented on NH-2687: ----------------------------------- Fabio, But this is part of the standard HiLo generator, it is not a new feature to be implemented on a custom generator. Shouldn't it be the responsible for the creation of these additional columns? Thanks, RP > SchemaExport Should Create HiLo Columns > --------------------------------------- > > Key: NH-2687 > URL: http://216.121.112.228/browse/NH-2687 > Project: NHibernate > Issue Type: Improvement > Components: Toolset > Affects Versions: 3.2.0Alpha2 > Reporter: Ricardo Peres > > The SchemaExport class, when creating a table for the HiLo algorithm, does not take in consideration any eventual columns specified as its parameters. > For example, if an entity is using a parameter defined as: > <param name="column">MyEntityColumn</param> > It should create table hibernate_unique_key with an additional MyEntityColumn column, but it does not. -- 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-04 11:12:56
|
[ http://216.121.112.228/browse/NH-2687?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2687. --------------------------- Resolution: Not an Issue Custom additional columns should be managed by you or your custom generator. An example is available here. http://code.google.com/p/codeconform/source/browse/ConfOrm/ConfOrm.UsageExamples/HighLowPerEntity/Demo.cs Please use the nhusers list for questions. > SchemaExport Should Create HiLo Columns > --------------------------------------- > > Key: NH-2687 > URL: http://216.121.112.228/browse/NH-2687 > Project: NHibernate > Issue Type: Improvement > Components: Toolset > Affects Versions: 3.2.0Alpha2 > Reporter: Ricardo Peres > > The SchemaExport class, when creating a table for the HiLo algorithm, does not take in consideration any eventual columns specified as its parameters. > For example, if an entity is using a parameter defined as: > <param name="column">MyEntityColumn</param> > It should create table hibernate_unique_key with an additional MyEntityColumn column, but it does not. -- 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: dabuddhaman (JIRA) <nh...@gm...> - 2011-05-04 08:33:54
|
SelectMany with cast throws QuerySyntaxException ------------------------------------------------ Key: NH-2688 URL: http://216.121.112.228/browse/NH-2688 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.2.0Alpha2 Reporter: dabuddhaman Priority: Major Attachments: SelectManyWithCastThrowsQuerySyntaxException.cs When trying to implement WCF dataservices using NHibernate I had a blocking error. the call to http://localhost:32774/NorthWindNHibernateDataService.svc/Orders(4)/OrderLines generated the following Linq query db.Orders.Where(element => element.OrderId == 4).SelectMany(element => (IEnumerable<OrderLine>)element.OrderLines) //{value(NHibernate.Linq.NhQueryable`1[OrderLines]).Where(element => (element.OrderId == 4)).SelectMany(element => Convert(element.OrderLines))} which throws a QuerySyntaxException -- 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: Jochen J. (JIRA) <nh...@gm...> - 2011-05-04 07:14:55
|
Using Validator and Envers together ----------------------------------- Key: NHV-117 URL: http://216.121.112.228/browse/NHV-117 Project: NHibernate.Validator Issue Type: Bug Components: Core Affects Versions: 1.3.1 GA Reporter: Jochen Jonckheere Priority: Major When I try to use NHibernate.Envers and NHibernate.Validator in the same project I get the following exception. Mesage: Object reference not set to an instance of an object. StackTrace: at NHibernate.Validator.Engine.SystemTypeExtensions.ShouldNeedValidation(Type clazz) at NHibernate.Validator.Engine.ValidatorEngine.GetClassValidator(Type entityType) at NHibernate.Validator.Engine.ValidatorEngine.AddValidator(Type entityType, IValidatableSubElementsInspector inspector) at NHibernate.Validator.Event.ValidatePreInsertEventListener.Initialize(Configuration cfg) at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg, Object[] list) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 618 at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 592 at NHibernate.Cfg.Configuration.GetInitializedEventListeners() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1189 at NHibernate.Cfg.Configuration.BuildSessionFactory() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1246 at ....Installers.NHibernateInstaller.SessionFactoryFactory(INHibernateConfigurator nHibernateConfigurator, INHibernateEnversConfigurator nHibernateEnversConfigurator) in ...\Installers\NHibernateInstaller.cs:line 81 Here's the part of the code that throws the exception: // Build the NHibernate Configuration var nHibernateConfiguration = nHibernateConfigurator.Configure(); // Initialize NHibernate Validator nHibernateConfiguration.Initialize(); // Initialize NHibernate Envers nHibernateConfiguration.IntegrateWithEnvers(nHibernateEnversConfigurator.Configure()); // Build the SessionFactory _factory = nHibernateConfiguration.BuildSessionFactory(); More info on: https://groups.google.com/d/topic/nhusers/gu9Gf5TrD_U/discussion And on: http://216.121.112.228/browse/NHE-11 -- 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: Roger (JIRA) <nh...@gm...> - 2011-05-03 18:46:57
|
[ http://216.121.112.228/browse/NHE-11?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Roger closed NHE-11. -------------------- Resolution: External Issue Assignee: Roger The stack trace says that the problem (probably) is caused in NHV. Closing this issue. Please report it to NHV instead. > Using Validator and Envers together > ----------------------------------- > > Key: NHE-11 > URL: http://216.121.112.228/browse/NHE-11 > Project: NHibernate.Envers > Issue Type: Bug > Components: Core > Affects Versions: 1.0 alpha 2 > Reporter: Jochen Jonckheere > Assignee: Roger > Priority: Blocker > > When I try to use NHibernate.Envers and NHibernate.Validator in the same project I get the following exception. > Mesage: Object reference not set to an instance of an object. > StackTrace: > at NHibernate.Validator.Engine.SystemTypeExtensions.ShouldNeedValidation(Type clazz) > at NHibernate.Validator.Engine.ValidatorEngine.GetClassValidator(Type entityType) > at NHibernate.Validator.Engine.ValidatorEngine.AddValidator(Type entityType, IValidatableSubElementsInspector inspector) > at NHibernate.Validator.Event.ValidatePreInsertEventListener.Initialize(Configuration cfg) > at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg, Object[] list) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 618 > at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 592 > at NHibernate.Cfg.Configuration.GetInitializedEventListeners() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1189 > at NHibernate.Cfg.Configuration.BuildSessionFactory() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1246 > at ....Installers.NHibernateInstaller.SessionFactoryFactory(INHibernateConfigurator nHibernateConfigurator, INHibernateEnversConfigurator nHibernateEnversConfigurator) in ...\Installers\NHibernateInstaller.cs:line 81 > Here's the part of the code that throws the exception: > // Build the NHibernate Configuration > var nHibernateConfiguration = nHibernateConfigurator.Configure(); > > // Initialize NHibernate Validator > nHibernateConfiguration.Initialize(); > > // Initialize NHibernate Envers > nHibernateConfiguration.IntegrateWithEnvers(nHibernateEnversConfigurator.Configure()); > // Build the SessionFactory > _factory = nHibernateConfiguration.BuildSessionFactory(); > More info on: https://groups.google.com/d/topic/nhusers/gu9Gf5TrD_U/discussion -- 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: Roger (JIRA) <nh...@gm...> - 2011-05-03 18:40:02
|
[ http://216.121.112.228/browse/NHE-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20992#action_20992 ] Roger commented on NHE-11: -------------------------- Jochen, I think the bug actually is in NH Validator (?). Please report this on NHV project instead. > Using Validator and Envers together > ----------------------------------- > > Key: NHE-11 > URL: http://216.121.112.228/browse/NHE-11 > Project: NHibernate.Envers > Issue Type: Bug > Components: Core > Affects Versions: 1.0 alpha 2 > Reporter: Jochen Jonckheere > Priority: Blocker > > When I try to use NHibernate.Envers and NHibernate.Validator in the same project I get the following exception. > Mesage: Object reference not set to an instance of an object. > StackTrace: > at NHibernate.Validator.Engine.SystemTypeExtensions.ShouldNeedValidation(Type clazz) > at NHibernate.Validator.Engine.ValidatorEngine.GetClassValidator(Type entityType) > at NHibernate.Validator.Engine.ValidatorEngine.AddValidator(Type entityType, IValidatableSubElementsInspector inspector) > at NHibernate.Validator.Event.ValidatePreInsertEventListener.Initialize(Configuration cfg) > at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg, Object[] list) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 618 > at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 592 > at NHibernate.Cfg.Configuration.GetInitializedEventListeners() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1189 > at NHibernate.Cfg.Configuration.BuildSessionFactory() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1246 > at ....Installers.NHibernateInstaller.SessionFactoryFactory(INHibernateConfigurator nHibernateConfigurator, INHibernateEnversConfigurator nHibernateEnversConfigurator) in ...\Installers\NHibernateInstaller.cs:line 81 > Here's the part of the code that throws the exception: > // Build the NHibernate Configuration > var nHibernateConfiguration = nHibernateConfigurator.Configure(); > > // Initialize NHibernate Validator > nHibernateConfiguration.Initialize(); > > // Initialize NHibernate Envers > nHibernateConfiguration.IntegrateWithEnvers(nHibernateEnversConfigurator.Configure()); > // Build the SessionFactory > _factory = nHibernateConfiguration.BuildSessionFactory(); > More info on: https://groups.google.com/d/topic/nhusers/gu9Gf5TrD_U/discussion -- 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: Jochen J. (JIRA) <nh...@gm...> - 2011-05-03 14:36:55
|
Using Validator and Envers together ----------------------------------- Key: NHE-11 URL: http://216.121.112.228/browse/NHE-11 Project: NHibernate.Envers Issue Type: Bug Components: Core Affects Versions: 1.0 alpha 2 Reporter: Jochen Jonckheere Priority: Blocker When I try to use NHibernate.Envers and NHibernate.Validator in the same project I get the following exception. Mesage: Object reference not set to an instance of an object. StackTrace: at NHibernate.Validator.Engine.SystemTypeExtensions.ShouldNeedValidation(Type clazz) at NHibernate.Validator.Engine.ValidatorEngine.GetClassValidator(Type entityType) at NHibernate.Validator.Engine.ValidatorEngine.AddValidator(Type entityType, IValidatableSubElementsInspector inspector) at NHibernate.Validator.Event.ValidatePreInsertEventListener.Initialize(Configuration cfg) at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg, Object[] list) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 618 at NHibernate.Event.EventListeners.InitializeListeners(Configuration cfg) in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Event\EventListeners.cs:line 592 at NHibernate.Cfg.Configuration.GetInitializedEventListeners() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1189 at NHibernate.Cfg.Configuration.BuildSessionFactory() in d:\CSharp\NH\NH\nhibernate\src\NHibernate\Cfg\Configuration.cs:line 1246 at ....Installers.NHibernateInstaller.SessionFactoryFactory(INHibernateConfigurator nHibernateConfigurator, INHibernateEnversConfigurator nHibernateEnversConfigurator) in ...\Installers\NHibernateInstaller.cs:line 81 Here's the part of the code that throws the exception: // Build the NHibernate Configuration var nHibernateConfiguration = nHibernateConfigurator.Configure(); // Initialize NHibernate Validator nHibernateConfiguration.Initialize(); // Initialize NHibernate Envers nHibernateConfiguration.IntegrateWithEnvers(nHibernateEnversConfigurator.Configure()); // Build the SessionFactory _factory = nHibernateConfiguration.BuildSessionFactory(); More info on: https://groups.google.com/d/topic/nhusers/gu9Gf5TrD_U/discussion -- 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: korkless (JIRA) <nh...@gm...> - 2011-05-03 13:30:58
|
[ http://216.121.112.228/browse/NHV-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20991#action_20991 ] korkless commented on NHV-116: ------------------------------ AbstractBytecodeProvider.ProxyFactoryFactory is not throwing ProxyFactoryFactoryNotConfiguredException but it returns the DefaultProxyFactoryFactory from the nhibernate revision 5479, so we can changed the code of NHibernateHelper from public static bool IsProxyFactoryConfigurated() { try { var f = NHibernate.Cfg.Environment.BytecodeProvider.ProxyFactoryFactory; return true; } catch (ProxyFactoryFactoryNotConfiguredException) { return false; } } to public static bool IsProxyFactoryConfigurated() { var f = NHibernate.Cfg.Environment.BytecodeProvider.ProxyFactoryFactory; return true != null; } it's a breaking change, i didn't find a way to keep compatile with the previous nhibernate versions > remove reference to obsolete NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException > ------------------------------------------------------------------------------------------ > > Key: NHV-116 > URL: http://216.121.112.228/browse/NHV-116 > Project: NHibernate.Validator > Issue Type: Bug > Components: Core > Affects Versions: 1.3.1 GA > Reporter: korkless > Priority: Critical > > in the nhibernate project revision 5718 the class ProxyFactoryFactoryNotConfiguredException has been deleted, > it is yet used in nhibernate.validator at least in the method NHibernate.Validator.Util.NHibernateHelper.IsProxyFactoryConfigurated() (i have only vs 2005 so i can't check if it's used in other places) -- 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: korkless (JIRA) <nh...@gm...> - 2011-05-03 12:46:57
|
[ http://216.121.112.228/browse/NHV-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20990#action_20990 ] korkless commented on NHV-116: ------------------------------ i see a bit and the problem seems a bit more complex, nhibernate.validator needs to been sync to the new proxy management of nhibernate 3.2 > remove reference to obsolete NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException > ------------------------------------------------------------------------------------------ > > Key: NHV-116 > URL: http://216.121.112.228/browse/NHV-116 > Project: NHibernate.Validator > Issue Type: Bug > Components: Core > Affects Versions: 1.3.1 GA > Reporter: korkless > Priority: Critical > > in the nhibernate project revision 5718 the class ProxyFactoryFactoryNotConfiguredException has been deleted, > it is yet used in nhibernate.validator at least in the method NHibernate.Validator.Util.NHibernateHelper.IsProxyFactoryConfigurated() (i have only vs 2005 so i can't check if it's used in other places) -- 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: korkless (JIRA) <nh...@gm...> - 2011-05-03 12:42:51
|
remove reference to obsolete NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException ------------------------------------------------------------------------------------------ Key: NHV-116 URL: http://216.121.112.228/browse/NHV-116 Project: NHibernate.Validator Issue Type: Bug Components: Core Affects Versions: 1.3.1 GA Reporter: korkless Priority: Critical in the nhibernate project revision 5718 the class ProxyFactoryFactoryNotConfiguredException has been deleted, it is yet used in nhibernate.validator at least in the method NHibernate.Validator.Util.NHibernateHelper.IsProxyFactoryConfigurated() (i have only vs 2005 so i can't check if it's used in other places) -- 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: Ricardo P. (JIRA) <nh...@gm...> - 2011-05-03 12:08:50
|
SchemaExport Should Create HiLo Columns --------------------------------------- Key: NH-2687 URL: http://216.121.112.228/browse/NH-2687 Project: NHibernate Issue Type: Improvement Components: Toolset Affects Versions: 3.2.0Alpha2 Reporter: Ricardo Peres The SchemaExport class, when creating a table for the HiLo algorithm, does not take in consideration any eventual columns specified as its parameters. For example, if an entity is using a parameter defined as: <param name="column">MyEntityColumn</param> It should create table hibernate_unique_key with an additional MyEntityColumn column, but it does not. -- 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-03 11:26:02
|
[ http://216.121.112.228/browse/NH-2577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20989#action_20989 ] Fabio Maulo commented on NH-2577: --------------------------------- Many people came to the party but no Martini. No Martini, no party. > nhibernate parameters binding order bug > --------------------------------------- > > Key: NH-2577 > URL: http://216.121.112.228/browse/NH-2577 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: sm > Priority: Major > > I am using latest nhibernate 3, my query: > iqt = rps.Terminals.GetQuery().Where(x => x.NetProtocol.Id == 4); > var res = iqt.OrderBy(x => x.Attributes[124]).ToList(); > //ITerminal have IDictionary<long,string> > When i look to the log file i see generated sql: > SELECT terminal0_.ID AS ID4_ , > terminal0_.ALIAS AS ALIAS4_ , > terminal0_.TTYPE_ID AS TTYPE3_4_ , > terminal0_.IP_ADDRESS AS IP4_4_ , > terminal0_.STREET AS STREET4_ , > terminal0_.LOCATION AS LOCATION4_ , > terminal0_.MODEL_ID AS MODEL7_4_ , > terminal0_.NODE_ID AS NODE8_4_ , > terminal0_.NETPROTOCOL_ID AS NETPROTO9_4_, > (SELECT (xml_desc(terminal0_.street,'UA')) > FROM terminals > WHERE terminals.id =terminal0_.Id > ) AS formula1_, > (SELECT (xml_desc(terminal0_.location,'UA')) > FROM terminals > WHERE terminals.id =terminal0_.Id > ) AS formula2_, > (SELECT (xml_desc(terminal_models.description,'EN')) > FROM terminal_models > WHERE terminal_models.id = terminal0_.MODEL_ID > ) AS formula3_ > FROM TERMINALS terminal0_, > TERM_ATTRIBUTES attributes1_ > WHERE terminal0_.ID =attributes1_.TERM_ID > AND attributes1_.ATTR_ID = :p0 > AND terminal0_.NETPROTOCOL_ID=:p1 //-> bug here it bind p1 with 124 value but correct p0 > ORDER BY attributes1_.VALUE ASC; > :p0 = 4 [Type: Int64 (0)], > :p1 = 124 [Type: Int64 (0)] > I think nhibernate could not correctly resolve parameters bind order with sub selects. > Thanks a lot -- 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-03 11:21:19
|
[ http://216.121.112.228/browse/NH-2587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2587. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > .Cacheable().Fetch() throws 'Exception occurred getter of xxx' > -------------------------------------------------------------- > > Key: NH-2587 > URL: http://216.121.112.228/browse/NH-2587 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Eduardo Segura > Assignee: Fabio Maulo > Priority: Major > Fix For: 3.2.0Alpha3 > > Attachments: CacheableFetchTest.zip > > > This query: > IList<ParentObject> pos = session.Query<ParentObject>().Cacheable().Fetch(po => po.ChildObjects).ToList(); > throws this exception: > NHibernate.PropertyAccessException: Exception occurred getter of CacheableFetchTest.Entity`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Id ---> System.Reflection.TargetException: Object does not match target type.. > For a detailed discussion, including full exception stacks, please see: > http://groups.google.com/group/nhusers/browse_thread/thread/dfdbe987d8450b0a/cb812c856e07ee0a -- 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-03 11:20:52
|
[ http://216.121.112.228/browse/NH-2587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo reassigned NH-2587: ------------------------------- Assignee: Fabio Maulo (was: Patrick Earl) > .Cacheable().Fetch() throws 'Exception occurred getter of xxx' > -------------------------------------------------------------- > > Key: NH-2587 > URL: http://216.121.112.228/browse/NH-2587 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Eduardo Segura > Assignee: Fabio Maulo > Priority: Major > Attachments: CacheableFetchTest.zip > > > This query: > IList<ParentObject> pos = session.Query<ParentObject>().Cacheable().Fetch(po => po.ChildObjects).ToList(); > throws this exception: > NHibernate.PropertyAccessException: Exception occurred getter of CacheableFetchTest.Entity`1[[System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Id ---> System.Reflection.TargetException: Object does not match target type.. > For a detailed discussion, including full exception stacks, please see: > http://groups.google.com/group/nhusers/browse_thread/thread/dfdbe987d8450b0a/cb812c856e07ee0a -- 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-02 15:42:49
|
[ http://216.121.112.228/browse/NH-2686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2686. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > Embedded ResultsTransformers should implements Equals/GetHashCode > ----------------------------------------------------------------- > > Key: NH-2686 > URL: http://216.121.112.228/browse/NH-2686 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Fabio Maulo > Priority: Minor > Fix For: 3.2.0Alpha3 > > > Related to NH-1525 -- 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-02 14:32:46
|
Embedded ResultsTransformers should implements Equals/GetHashCode ----------------------------------------------------------------- Key: NH-2686 URL: http://216.121.112.228/browse/NH-2686 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.1.0 Reporter: Fabio Maulo Priority: Minor Related to NH-1525 -- 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-02 14:27:46
|
[ http://216.121.112.228/browse/NH-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2685. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > Unnecessary proxy initialisation in CriteriaQueryTranslator > ----------------------------------------------------------- > > Key: NH-2685 > URL: http://216.121.112.228/browse/NH-2685 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0, 3.2.0Alpha1, 3.2.0Alpha2 > Reporter: Marc Gerritsen > Priority: Minor > Fix For: 3.2.0Alpha3 > > Attachments: Unnecessary proxy initialisation in CriteriaQueryTranslator.patch > > > For the construction of a debug string the ToString method is called on a proxy. > This initializes the proxy unnecessary. > To make sure this does not happen anymore i wrapped the logger lines with if (logger.IsDebugEnabled). > I attached the patch I created to fix the bug. -- 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-02 14:10:27
|
[ http://216.121.112.228/browse/NH-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2673. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > Nhibernate 2nd level cache and Result transformer > ------------------------------------------------- > > Key: NH-2673 > URL: http://216.121.112.228/browse/NH-2673 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.2.0Alpha2 > Reporter: Josef Holan > Priority: Minor > Fix For: 3.2.0Alpha3 > > Attachments: Caching.zip > > > I have a big problem with 2nd level cache in NHibernate. Everything is working fine(Cache is running well) until I use > .SetResultTransformer(new DistinctRootEntityResultTransformer()) > Example code: > using (var session = SessionFactory.OpenSession()) > { > Console.WriteLine("---> using query first time"); > var query = session > .CreateQuery("from Blog b where b.Author = :author") > .SetString("author", "Gabriel") > .SetCacheable(true) > .SetResultTransformer(new DistinctRootEntityResultTransformer()) > ; > var list = query.List<Blog>(); > } > Exception: > NHibernate.PropertyAccessException: Exception occurred getter of Caching.Blog.Id > v NHibernate.Properties.BasicPropertyAccessor.BasicGetter.Get(Object target) v d:\CSharp\NH\NH\nhibernate\src\NHibernate\Properties\BasicPropertyAccessor.cs: line 211 > v NHibernate.Tuple.Entity.AbstractEntityTuplizer.GetIdentifier(Object entity) v d:\CSharp\NH\NH\nhibernate\src\NHibernate\Tuple\Entity\AbstractEntityTuplizer.cs: line 139 > v NHibernate.Persister.Entity.AbstractEntityPersister.GetIdentifier(Object obj, EntityMode entityMode) v d:\CSharp\NH\NH\nhibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs: line 3883 > v NHibernate.Persister.Entity.AbstractEntityPersister.IsTransient(Object entity, ISessionImplementor session) v d:\CSharp\NH\NH\nhibernate\src\NHibernate\Persister\Entity\AbstractEntityPersister.cs: line 3669 > v NHibernate.Engine.ForeignKeys.IsTransient(String entityName, Object entity, Nullable`1 assumed, ISessionImplementor session) v ForeignKeys.cs: line 194 > v NHibernate.Engine.ForeignKeys.GetEntityIdentifierIfNotUnsaved(String entityName, Object entity, ISessionImplementor session) v ForeignKeys.cs: line 250 > v NHibernate.Type.ManyToOneType.Disassemble(Object value, ISessionImplementor session, Object owner) v ManyToOneType.cs: line 137 > v NHibernate.Cache.StandardQueryCache.Put(QueryKey key, ICacheAssembler[] returnTypes, IList result, Boolean isNaturalKeyLookup, ISessionImplementor session) v StandardQueryCache.cs: line 82 > v NHibernate.Loader.Loader.PutResultInQueryCache(ISessionImplementor session, QueryParameters queryParameters, IType[] resultTypes, IQueryCache queryCache, QueryKey key, IList result) v Loader.cs: line 1668 > v NHibernate.Loader.Loader.ListUsingQueryCache(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) v Loader.cs: line 1617 > v NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) v Loader.cs: line 1591 > v NHibernate.Hql.Ast.ANTLR.Loader.QueryLoader.List(ISessionImplementor session, QueryParameters queryParameters) v QueryLoader.cs: line 300 > v NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.List(ISessionImplementor session, QueryParameters queryParameters) v QueryTranslatorImpl.cs: line 111 > v NHibernate.Engine.Query.HQLQueryPlan.PerformList(QueryParameters queryParameters, ISessionImplementor session, IList results) v HQLQueryPlan.cs: line 105 > v NHibernate.Impl.SessionImpl.List(String query, QueryParameters queryParameters, IList results) v SessionImpl.cs: line 616 > v NHibernate.Impl.SessionImpl.List<T>(String query, QueryParameters parameters) v SessionImpl.cs: line 592 > v NHibernate.Impl.QueryImpl.List<T>() v QueryImpl.cs: line 94 > v UnitTests.when_having_blog_with_posts.trying_to_cache_a_complex_query() v Blog_Spec.cs: line 110 > Mapping: > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" > namespace="Caching" > assembly="Caching"> > <class name="Blog"> > <cache usage="read-write"/> > <id name="Id"> > <generator class="hilo"/> > </id> > <property name="Author"/> > <property name="Name"/> > <set name="Posts" cascade="all" lazy="true"> > <cache usage="read-write"/> > <key column="BlogId"/> > <one-to-many class="Post"/> > </set> > </class> > <class name="Post"> > <cache usage="read-write"/> > <id name="Id"> > <generator class="hilo"/> > </id> > <property name="Title"/> > <property name="Body"/> > </class> > </hibernate-mapping> > Classes: > public class Blog > { > public virtual int Id { get; set; } > public virtual string Author { get; set; } > public virtual string Name { get; set; } > public virtual ISet<Post> Posts { get; set; } > public Blog() > { > Posts = new HashedSet<Post>(); > } > } > public class Post > { > public virtual int Id { get; private set; } > public virtual string Title { get; set; } > public virtual string Body { get; set; } > } > nhibernate.config: > <property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider</property> > <property name="cache.use_second_level_cache">true</property> > <property name="cache.use_query_cache" >true</property> > In summary: Cache and nhibernate running well until i use result transformer. To work i must disable transformer or 2nd level cache. It is not working together > This is only example, i know that distinct in this situation is stupid. -- 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-02 14:10:08
|
[ http://216.121.112.228/browse/NH-1344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-1344. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > QueryTranslator: Invalid Cast to object array when using IResultTransformer > --------------------------------------------------------------------------- > > Key: NH-1344 > URL: http://216.121.112.228/browse/NH-1344 > Project: NHibernate > Issue Type: Sub-task > Components: Core > Affects Versions: 1.2.1, 2.0.0.Alpha2 > Reporter: Stefan Simroth > Priority: Minor > Fix For: 3.2.0Alpha3 > > Attachments: QueryTranslatorInvalidCastToObjectArray20trunk.patch > > > there seems to be an issue with a hard cast in the QueryTranslator > class, line 1452 (trunk) - resp. line 1288 (1.2.1) ... > The hard cast in method GetResultList to an object[] fails in the case > of my company's product, when using an IResultTransformer. > I chose to use an IResultTransformer implementation for Criteria's and > Query's to be able to set a required property. It seems an appropriate > way to me and my tests (and the running app) ensure that it works. > However, I had to patch the QueryTranslator at the locations mentioned > above, because it threw an invalid cast exception (stacktrace below) - > because the IList of my objects could not be casted to an object[]. > Debugging it, showed me that the "results" list contained my domain > objects, but it could not be casted to an object[]. It was a collection > of my domain types and my domain types are no object[]. Now, some time > passed by since then, and our product works fine with the patch, so > unfortunately I forgot the exact reason, but I'd guess, I used the > generic Query signature and so the results list was a generic list that > cannot be casted to object[]. But also ArrayList or Hashtable cannot be > casted to object[]... > A little experiment, gave me the compiler error: > Cannot convert type > 'System.Collections.Generic.List<ConsoleApplication1.Project>' to 'object[]' > class Program > { > static void Main(string[] args) > { > List<Project> projects = new List<Project>(); > object[] objs = (object[]) projects; > } > class Project { } > } > => same thing doesn't work with ArrayList or Hashtable ... > ---- > The code snippet from QueryTranslator in question: > for (int i = 0; i < results.Count; i++) > { > object[] row = (object[]) results[i]; > results[i] = holderInstantiator.Instantiate(row); > } > ---- > Patch - with a "safe" cast: > object[] row = results[i] as object[]; > if (row != null) > { > results[i] = holderInstantiator.Instantiate(row); > } > The included patch is for the NHibernate 2.0 trunk. > The same problem exists in earlier versions, namely 1.2. > I might be totally missing the root of the problem, but please excuse > this, as I am not familiar with the NHibernate internals, but tried to > apply a patch at the right place to enable the very useful feature of > the IResultTransformer to our case - and maybe to others in future. > Here is the stacktrace: (version 1.2.1) > at NHibernate.Hql.Classic.QueryTranslator.GetResultList(IList > results, IResultTransformer resultTransformer) in > d:\dev\yap\nhibernate\trunk\src\NHibernate\Hql\Classic\QueryTranslator.cs:line > 1291 > at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor > session, QueryParameters queryParameters) in > d:\dev\yap\nhibernate\trunk\src\NHibernate\Loader\Loader.cs:line 1744 > at NHibernate.Loader.Loader.List(ISessionImplementor session, > QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes) > in d:\dev\yap\nhibernate\trunk\src\NHibernate\Loader\Loader.cs:line 1738 > at NHibernate.Hql.Classic.QueryTranslator.List(ISessionImplementor > session, QueryParameters queryParameters) in > d:\dev\yap\nhibernate\trunk\src\NHibernate\Hql\Classic\QueryTranslator.cs:line > 1124 > at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters > parameters, IList results) in > d:\dev\yap\nhibernate\trunk\src\NHibernate\Impl\SessionImpl.cs:line 1763 > ---- > My IResultTransformer implementation: > #region IResultTransformer Members > public object TransformTuple(object[] tuple, string[] aliases) > { > object o = CriteriaUtil.RootEntity.TransformTuple(tuple, aliases); > TrySetDomainModelStore(o); > return o; > } > public IList TransformList(IList collection) > { > for (int i = 0; i < collection.Count; i++) > { > TrySetDomainModelStore(collection[i]); > } > return collection; > } > #endregion > TranformTuple is called rarely. TransformList is called after the > HolderInstantiator call. > I never create a new MyEntity[] { my, domain, entities}, nor a new > object[] { my, domain, entities} ... > ------ > Felix Gartsman: > Isn't this similar to Hibernate issues: > http://opensource.atlassian.com/projects/hibernate/browse/HHH-2463 > http://opensource.atlassian.com/projects/hibernate/browse/HHH-2525 > They are also present in NH, and they prevent caching queries with > IResultTransformer - the caching thinks it gets a tuple, but it's actually > the transformed object. -- 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-02 14:09:47
|
[ http://216.121.112.228/browse/NH-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-1090. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > Query cache does not work when using Criteria API to create a projection query with a result transformer > -------------------------------------------------------------------------------------------------------- > > Key: NH-1090 > URL: http://216.121.112.228/browse/NH-1090 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 1.2.0.GA, 1.2.1, 2.0.0.GA, 2.0.1.GA > Reporter: Olli Ryhänen > Priority: Major > Fix For: 3.2.0Alpha3 > > Attachments: NH1090-sideeffect.zip > > > Enabling query-cache on a projection query with a result transformer attached using Criteria API, will fail with an exception: > "System.InvalidCastException: Unable to cast object of type '<The output type from the result transformer' to type 'System.Object[]'" > The exception is caused by the line: > "cacheable.Add( TypeFactory.Disassemble( ( object[ ] ) result[ i ], returnTypes, session ) );" > in "NHibernate\Cache\StandardQueryCache.cs" on line 63, when it tries to cast the "result[i]" to an "object[]". > Using result transformers the result set has already been transformed to the transformed type, before adding to the cache, so casting to "object[]" will fail. (The transformation is done in the method "GetResultColumnOrRow" in CriteriaLoader.cs on line 74, which gets called in process of loading the result set from the database). > To reproduce the issue, turn on caching on any of the projection query tests with result transformer in "CriteriaQueryTests.cs". E.g. on line 494 > IList resultWithAliasedBean = s.CreateCriteria(typeof (Enrolment)) > .CreateAlias("Student", "st") > .CreateAlias("Course", "co") > .SetProjection(Projections.ProjectionList() > .Add(Projections.Property("st.Name"), "studentName") > .Add(Projections.Property("co.Description"), "courseDescription") > ) > .AddOrder(Order.Desc("studentName")) > .SetResultTransformer(Transformers.AliasToBean(typeof (StudentDTO))) > .SetCacheable(true) > .List(); > A simple fix would be to check if the type of "result[i]" is an "object[]" before adding to the cache and cache non "object[]" types as is to the cache (and do the same check when getting the items back from the cache), but I'm not sure if that would break the caching architecture in some way. -- 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 |