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-04-26 19:24:13
|
[ http://216.121.112.228/browse/NH-2678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2678: ---------------------------- Issue Type: Improvement (was: Bug) > NotSupportedException in NewArrayInitExpression > ----------------------------------------------- > > Key: NH-2678 > URL: http://216.121.112.228/browse/NH-2678 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Michael Teper > Priority: Major > > The following LINQ query throws a NotSupportedException in NewArrayInitExpression: > var results = from node in ISession.Query<Node>() > select new[] { node.Manager }.Union(node.Subordinates); > In the example above, Manager is of type Person and Subordinates is a collection of Persons. -- 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-04-26 19:24:12
|
[ http://216.121.112.228/browse/NH-2679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20974#action_20974 ] Fabio Maulo commented on NH-2679: --------------------------------- Please, mappings and classes to create a test if you don't want send us a test. > The UnionResultOperator result operator is not current supported > ---------------------------------------------------------------- > > Key: NH-2679 > URL: http://216.121.112.228/browse/NH-2679 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Michael Teper > Priority: Major > > var result1 = from foo in ISession.Query<Foo> > where ... > select foo.Bar; > var result2 = from foo in ISession.Query<Foo> > where ... > select foo.Bar; > var result3 = result1.Union(result2); -- 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-04-26 19:24:00
|
[ http://216.121.112.228/browse/NH-2678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20973#action_20973 ] Fabio Maulo commented on NH-2678: --------------------------------- Please, mappings and classes to create a test if you don't want send us a test. > NotSupportedException in NewArrayInitExpression > ----------------------------------------------- > > Key: NH-2678 > URL: http://216.121.112.228/browse/NH-2678 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Michael Teper > Priority: Major > > The following LINQ query throws a NotSupportedException in NewArrayInitExpression: > var results = from node in ISession.Query<Node>() > select new[] { node.Manager }.Union(node.Subordinates); > In the example above, Manager is of type Person and Subordinates is a collection of Persons. -- 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: Michael T. (JIRA) <nh...@gm...> - 2011-04-26 19:19:51
|
The UnionResultOperator result operator is not current supported ---------------------------------------------------------------- Key: NH-2679 URL: http://216.121.112.228/browse/NH-2679 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.1.0 Reporter: Michael Teper Priority: Major var result1 = from foo in ISession.Query<Foo> where ... select foo.Bar; var result2 = from foo in ISession.Query<Foo> where ... select foo.Bar; var result3 = result1.Union(result2); -- 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: Michael T. (JIRA) <nh...@gm...> - 2011-04-26 19:03:52
|
NotSupportedException in NewArrayInitExpression ----------------------------------------------- Key: NH-2678 URL: http://216.121.112.228/browse/NH-2678 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.1.0 Reporter: Michael Teper Priority: Major The following LINQ query throws a NotSupportedException in NewArrayInitExpression: var results = from node in ISession.Query<Node>() select new[] { node.Manager }.Union(node.Subordinates); In the example above, Manager is of type Person and Subordinates is a collection of Persons. -- 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: Josef H. (JIRA) <nh...@gm...> - 2011-04-26 18:00:59
|
[ http://216.121.112.228/browse/NH-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20972#action_20972 ] Josef Holan commented on NH-2673: --------------------------------- Hi, this is key function of nhibernate in my application in company. Is there a workaround or possibility to quick repair? I need 2nd level cache and result transformer working together. Thanks. Josef > 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 > 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-04-26 17:55:02
|
[ http://216.121.112.228/browse/NH-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20971#action_20971 ] Fabio Maulo commented on NH-2583: --------------------------------- Now is 25% instead 50%. ;) > Query with || operator and navigations (many-to-one) creates wrong joins > ------------------------------------------------------------------------ > > Key: NH-2583 > URL: http://216.121.112.228/browse/NH-2583 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Harald M. Müller > Assignee: Patrick Earl > Priority: Critical > Attachments: JoinOptimizationForPureOuterJoinSemantics.txt, LogicalOperatorsInNHibernateLinq.txt, NH-2583a.diff, NH-2583b.diff, NH-2583c.diff, NH-2583d.diff, NH-2583e.diff, NH-2583f.diff, NH-2583g.diff, NH-2583g2ndTry.patch, NH2583.7z, NHib3.0.0Or.zip > > > The following query > var result = session.Query<MyBO>() > .Where(bo => > (bo.BO1 != null && bo.BO1.I2 == 101) || > (bo.BO2 != null && bo.BO2.J2 == 203) > ) > ; > result.ToList(); > creates the following SQL on SQL Server 2008 (with .Net 4.0, MsSql2008Dialect): > exec sp_executesql N'select mybo0_.Id as Id0_, mybo0_.Name as Name0_, mybo0_.BO1Key as BO3_0_, mybo0_.OtherBO1Key as OtherBO4_0_, mybo0_.BO2Key as BO5_0_ from MyBO mybo0_, MyRef1 myref1x1_, MyRef2 myref2x2_ where mybo0_.BO1Key=myref1x1_.Id and mybo0_.BO2Key=myref2x2_.Id and ((mybo0_.BO1Key is not null) and myref1x1_.I2=@p0 or (mybo0_.BO2Key is not null) and myref2x2_.J2=@p1)',N'@p0 int,@p1 int',@p0=101,@p1=203 > or, formatted: > SELECT mybo0_.id AS id0_, > mybo0_.name AS name0_, > mybo0_.bo1key AS bo3_0_, > mybo0_.otherbo1key AS otherbo4_0_, > mybo0_.bo2key AS bo5_0_ > FROM mybo mybo0_, > myref1 myref1x1_, > myref2 myref2x2_ > WHERE mybo0_.bo1key = myref1x1_.id -- inner (table) join > AND mybo0_.bo2key = myref2x2_.id -- also inner (table) join > AND ( ( mybo0_.bo1key IS NOT NULL ) > AND myref1x1_.i2 = @p0 > OR ( mybo0_.bo2key IS NOT NULL ) > AND myref2x2_.j2 = @p1 ) > This is wrong if the reference to ref1 or ref2 is null. The attachment contains a small project that shows the problem. > AFAIK, the problem has been always present when using HQL navigations (a.b.c....); it is - somewhat implicitly - documented in seciotn 13.7.: > Compound path expressions make the where clause extremely powerful. Consider: > from Eg.Cat cat where cat.Mate.Name is not null > This query translates to an SQL query with a table (inner) join. > In HQL, one can claim that this is "a feature" (and the workaround is to use manual JOINs). With Linq, this is no longer possible - the semantics of the || operator should be correctly implemented, shouldn't it? Therefore, I dared to mark this bug as "Critical". > (... or - please - show me that I'm wrong and that || + navigation work as expected!). > Remark: In our project, which started with NHib 0.99 six years ago, we(I) wrote a complete expression framework akin to Linq (but only with conditions, not with expressions). When we found this problem, I rewrote the HQL builder so that it then created (and still creates) correct INNER or OUTER JOINs, depending on the expression tree (one has to consider Is-Null/Is-Not-Null operators and Not nodes above these, as far as I remember ... I'd have to look into our code). -- 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-04-26 17:53:11
|
[ http://216.121.112.228/browse/NH-2677?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2677. --------------------------- Resolution: Not an Issue You can't use that transformer when you are selecting two entities. You need a custom transformer taking just the first one or you have to change the select clause. For questions please use the nhusers group. Thanks. > CreateSQLQuery (used with AddEntity, AddJoin) resutls with cartesian product (not distincted entities) > ------------------------------------------------------------------------------------------------------ > > Key: NH-2677 > URL: http://216.121.112.228/browse/NH-2677 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Mariusz Florek > > To get test case for this issue add another employment entity in [Test] public void SQLQueryInterface() method: > Employment emp1 = new Employment(gavin, jboss, "AU1"); > s.Save(emp1); > in a file: > NHibernate-3.1.0.GA-src\src\NHibernate.Test\SqlTest\Query\NativeSQLQueriesFixture.cs > (I used NHibernate 3.1.0.GA source code) > Following code will result distincted Employment entities instead of expected Organization ones (I've tested it also in other structures - with similar results): > s = OpenSession(); > t = s.BeginTransaction(); > l = s.CreateSQLQuery("select {org.*}, {emp.*} " + > "from ORGANIZATION org " + > " left outer join EMPLOYMENT emp on org.ORGID = emp.EMPLOYER") > .AddEntity("org", typeof(Organization)) > .AddJoin("emp", "org.employments") > .SetResultTransformer(new DistinctRootEntityResultTransformer()) > .List(); > t.Commit(); > s.Close(); > Look at: > public object TransformTuple(object[] tuple, string[] aliases) > method in class: > DistinctRootEntityResultTransformer > implementation - when changed to: return tuple[0]; - works properly (this is hint - not solution). > Cheers, > Mariusz > BTW - is it possible to get partial data from native sql transformed to entities f.e.: > select a.Name, b.Category from Table1 a, Table2 b where a.table1_id = b.table1_id > that will result as IList<Table1> (not a.*, b.*)? - link to example is welcome ;) -- 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: Patrick E. (JIRA) <nh...@gm...> - 2011-04-26 17:53:04
|
[ http://216.121.112.228/browse/NH-2583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20969#action_20969 ] Patrick Earl commented on NH-2583: ---------------------------------- Unfortunately the tests for this roughly doubled the build time. We should cut that down significantly. > Query with || operator and navigations (many-to-one) creates wrong joins > ------------------------------------------------------------------------ > > Key: NH-2583 > URL: http://216.121.112.228/browse/NH-2583 > Project: NHibernate > Issue Type: Bug > Components: Linq Provider > Affects Versions: 3.1.0 > Reporter: Harald M. Müller > Assignee: Patrick Earl > Priority: Critical > Attachments: JoinOptimizationForPureOuterJoinSemantics.txt, LogicalOperatorsInNHibernateLinq.txt, NH-2583a.diff, NH-2583b.diff, NH-2583c.diff, NH-2583d.diff, NH-2583e.diff, NH-2583f.diff, NH-2583g.diff, NH-2583g2ndTry.patch, NH2583.7z, NHib3.0.0Or.zip > > > The following query > var result = session.Query<MyBO>() > .Where(bo => > (bo.BO1 != null && bo.BO1.I2 == 101) || > (bo.BO2 != null && bo.BO2.J2 == 203) > ) > ; > result.ToList(); > creates the following SQL on SQL Server 2008 (with .Net 4.0, MsSql2008Dialect): > exec sp_executesql N'select mybo0_.Id as Id0_, mybo0_.Name as Name0_, mybo0_.BO1Key as BO3_0_, mybo0_.OtherBO1Key as OtherBO4_0_, mybo0_.BO2Key as BO5_0_ from MyBO mybo0_, MyRef1 myref1x1_, MyRef2 myref2x2_ where mybo0_.BO1Key=myref1x1_.Id and mybo0_.BO2Key=myref2x2_.Id and ((mybo0_.BO1Key is not null) and myref1x1_.I2=@p0 or (mybo0_.BO2Key is not null) and myref2x2_.J2=@p1)',N'@p0 int,@p1 int',@p0=101,@p1=203 > or, formatted: > SELECT mybo0_.id AS id0_, > mybo0_.name AS name0_, > mybo0_.bo1key AS bo3_0_, > mybo0_.otherbo1key AS otherbo4_0_, > mybo0_.bo2key AS bo5_0_ > FROM mybo mybo0_, > myref1 myref1x1_, > myref2 myref2x2_ > WHERE mybo0_.bo1key = myref1x1_.id -- inner (table) join > AND mybo0_.bo2key = myref2x2_.id -- also inner (table) join > AND ( ( mybo0_.bo1key IS NOT NULL ) > AND myref1x1_.i2 = @p0 > OR ( mybo0_.bo2key IS NOT NULL ) > AND myref2x2_.j2 = @p1 ) > This is wrong if the reference to ref1 or ref2 is null. The attachment contains a small project that shows the problem. > AFAIK, the problem has been always present when using HQL navigations (a.b.c....); it is - somewhat implicitly - documented in seciotn 13.7.: > Compound path expressions make the where clause extremely powerful. Consider: > from Eg.Cat cat where cat.Mate.Name is not null > This query translates to an SQL query with a table (inner) join. > In HQL, one can claim that this is "a feature" (and the workaround is to use manual JOINs). With Linq, this is no longer possible - the semantics of the || operator should be correctly implemented, shouldn't it? Therefore, I dared to mark this bug as "Critical". > (... or - please - show me that I'm wrong and that || + navigation work as expected!). > Remark: In our project, which started with NHib 0.99 six years ago, we(I) wrote a complete expression framework akin to Linq (but only with conditions, not with expressions). When we found this problem, I rewrote the HQL builder so that it then created (and still creates) correct INNER or OUTER JOINs, depending on the expression tree (one has to consider Is-Null/Is-Not-Null operators and Not nodes above these, as far as I remember ... I'd have to look into our code). -- 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: Mariusz F. (JIRA) <nh...@gm...> - 2011-04-26 17:37:56
|
CreateSQLQuery (used with AddEntity, AddJoin) resutls with cartesian product (not distincted entities) ------------------------------------------------------------------------------------------------------ Key: NH-2677 URL: http://216.121.112.228/browse/NH-2677 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.1.0 Reporter: Mariusz Florek To get test case for this issue add another employment entity in [Test] public void SQLQueryInterface() method: Employment emp1 = new Employment(gavin, jboss, "AU1"); s.Save(emp1); in a file: NHibernate-3.1.0.GA-src\src\NHibernate.Test\SqlTest\Query\NativeSQLQueriesFixture.cs (I used NHibernate 3.1.0.GA source code) Following code will result distincted Employment entities instead of expected Organization ones (I've tested it also in other structures - with similar results): s = OpenSession(); t = s.BeginTransaction(); l = s.CreateSQLQuery("select {org.*}, {emp.*} " + "from ORGANIZATION org " + " left outer join EMPLOYMENT emp on org.ORGID = emp.EMPLOYER") .AddEntity("org", typeof(Organization)) .AddJoin("emp", "org.employments") .SetResultTransformer(new DistinctRootEntityResultTransformer()) .List(); t.Commit(); s.Close(); Look at: public object TransformTuple(object[] tuple, string[] aliases) method in class: DistinctRootEntityResultTransformer implementation - when changed to: return tuple[0]; - works properly (this is hint - not solution). Cheers, Mariusz BTW - is it possible to get partial data from native sql transformed to entities f.e.: select a.Name, b.Category from Table1 a, Table2 b where a.table1_id = b.table1_id that will result as IList<Table1> (not a.*, b.*)? - link to example is welcome ;) -- 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-04-26 14:11:51
|
[ http://216.121.112.228/browse/NH-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2676: ---------------------------- Priority: Trivial (was: Major) > paged join fetch with OpenStatelessSession always results the same rows regardless of SetFirstRow parameter > ----------------------------------------------------------------------------------------------------------- > > Key: NH-2676 > URL: http://216.121.112.228/browse/NH-2676 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Mariusz Florek > Attachments: Domain-Customer.zip > > > I tested results of HQL query using standard and stateless session: > from Customer c > join fetch c.Orders as o > left join fetch o.OrderLines as ol > join fetch ol.Product p > order by c.CompanyName > I tried to limit result count using SetFirstResult(...) and SetMaxResults(...) on IQuery object. > For test I used MsSql2008DialectLinqReadonlyCreateScript.sql from NHibernate 3.1.0-GA zip with binaries. > With standard session I got proper results - with stateless session I always got first N (set with SetMaxResults) objects regardless of value set with SetFirstResult. > Additionally query ran with stateless session consumed twice execution time (although I expected it to be faster). > Problem exists also with simpler join example: > from Customer c > join fetch c.Orders > order by c.CompanyName > BTW - how NHibernate process such queries (how resolves page to read - I can see only not limited SQL generated)? > Cheers, > Mariusz -- 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-04-26 13:58:51
|
[ http://216.121.112.228/browse/NH-2674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2674. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > QueryOver doesn't have support for entity-name > ---------------------------------------------- > > Key: NH-2674 > URL: http://216.121.112.228/browse/NH-2674 > Project: NHibernate > Issue Type: New Feature > Components: QueryOver > Affects Versions: 3.2.0Alpha2 > Reporter: Rostislav Pridatko > Assignee: Fabio Maulo > Priority: Minor > Fix For: 3.2.0Alpha3 > > > We're currently using ICriteria in our project and we liked the new QueryOver syntax and want to use it throughout the project. Currently the main showstopper for us is the lack of support for entity-name in QueryOver. I've read the following discussion here: > https://groups.google.com/group/nhusers/browse_thread/thread/de9df28b4cb57985?pli=1 > and we have exactly the same situation in our project - we have one POCO class but several maps for it and we use entity-name to switch to a proper database table/view at run time. > I looked at the code in trunk of NHibernate and looks like adding support for entity-name in QueryOver should be pretty easy and should not affect existing code. > We'll just need to add one method overload to NHibernate.Impl.SessionImpl (and ISession): > public IQueryOver<T, T> QueryOver<T>(string entityName) where T : class > { > using (new SessionIdLoggingContext(SessionId)) > { > CheckAndUpdateSessionStatus(); > return new QueryOver<T, T>(new CriteriaImpl(entityName, this)); > } > } > and another one to NHibernate.Criterion.QueryOver: > public static QueryOver<T, T> Of<T>(string entityName) > { > return new QueryOver<T, T>(new CriteriaImpl(entityName, null)); > } > I may be missing something here; is this lack of support for entity-name in QueryOver an intentional decision or is it just something that no one ever got to due to lack of time? > Can I create and upload a patch or do I need some extra permissions here? > Sorry for bothering you with questions, couldn't find any FAQ or policy on how to contribute to the project. Thanks. -- 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-04-26 13:30:52
|
[ http://216.121.112.228/browse/NH-2674?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo reassigned NH-2674: ------------------------------- Assignee: Fabio Maulo > QueryOver doesn't have support for entity-name > ---------------------------------------------- > > Key: NH-2674 > URL: http://216.121.112.228/browse/NH-2674 > Project: NHibernate > Issue Type: New Feature > Components: QueryOver > Affects Versions: 3.2.0Alpha2 > Reporter: Rostislav Pridatko > Assignee: Fabio Maulo > Priority: Minor > > We're currently using ICriteria in our project and we liked the new QueryOver syntax and want to use it throughout the project. Currently the main showstopper for us is the lack of support for entity-name in QueryOver. I've read the following discussion here: > https://groups.google.com/group/nhusers/browse_thread/thread/de9df28b4cb57985?pli=1 > and we have exactly the same situation in our project - we have one POCO class but several maps for it and we use entity-name to switch to a proper database table/view at run time. > I looked at the code in trunk of NHibernate and looks like adding support for entity-name in QueryOver should be pretty easy and should not affect existing code. > We'll just need to add one method overload to NHibernate.Impl.SessionImpl (and ISession): > public IQueryOver<T, T> QueryOver<T>(string entityName) where T : class > { > using (new SessionIdLoggingContext(SessionId)) > { > CheckAndUpdateSessionStatus(); > return new QueryOver<T, T>(new CriteriaImpl(entityName, this)); > } > } > and another one to NHibernate.Criterion.QueryOver: > public static QueryOver<T, T> Of<T>(string entityName) > { > return new QueryOver<T, T>(new CriteriaImpl(entityName, null)); > } > I may be missing something here; is this lack of support for entity-name in QueryOver an intentional decision or is it just something that no one ever got to due to lack of time? > Can I create and upload a patch or do I need some extra permissions here? > Sorry for bothering you with questions, couldn't find any FAQ or policy on how to contribute to the project. Thanks. -- 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: Mariusz F. (JIRA) <nh...@gm...> - 2011-04-26 13:21:00
|
[ http://216.121.112.228/browse/NH-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20968#action_20968 ] Mariusz Florek commented on NH-2676: ------------------------------------ I've forgotten to add transaction handling in previous test code - I think this is not problem for you to add it ;) > paged join fetch with OpenStatelessSession always results the same rows regardless of SetFirstRow parameter > ----------------------------------------------------------------------------------------------------------- > > Key: NH-2676 > URL: http://216.121.112.228/browse/NH-2676 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Mariusz Florek > Priority: Major > Attachments: Domain-Customer.zip > > > I tested results of HQL query using standard and stateless session: > from Customer c > join fetch c.Orders as o > left join fetch o.OrderLines as ol > join fetch ol.Product p > order by c.CompanyName > I tried to limit result count using SetFirstResult(...) and SetMaxResults(...) on IQuery object. > For test I used MsSql2008DialectLinqReadonlyCreateScript.sql from NHibernate 3.1.0-GA zip with binaries. > With standard session I got proper results - with stateless session I always got first N (set with SetMaxResults) objects regardless of value set with SetFirstResult. > Additionally query ran with stateless session consumed twice execution time (although I expected it to be faster). > Problem exists also with simpler join example: > from Customer c > join fetch c.Orders > order by c.CompanyName > BTW - how NHibernate process such queries (how resolves page to read - I can see only not limited SQL generated)? > Cheers, > Mariusz -- 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: Mariusz F. (JIRA) <nh...@gm...> - 2011-04-26 13:15:56
|
[ http://216.121.112.228/browse/NH-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mariusz Florek updated NH-2676: ------------------------------- Attachment: Domain-Customer.zip 1. Create test SQL Server database using following script: http://switch.dl.sourceforge.net/project/nhibernate/NHibernate/3.1.0.GA/NHibernate-3.1.0.GA-bin.zip/Tests/DbScripts/MsSql2008DialectLinqReadonlyCreateScript.sql (I tested it in Express 2008 Version) 2. Domain classes, hbm and cfg is in an attachment (VS 2008 Windows Library Project) 3. Use code as follow for test: string q = @" from Customer c join fetch c.Orders as o left join fetch o.OrderLines as ol join fetch ol.Product p order by c.CompanyName "; var sf = // put ISessionFactory reference here for(int i = 0; i < 5; i++) { // var s = sf.OpenSession(); // works fine var s = sf.OpenStatelessSession(); try { var list = s.CreateQuery(q) .SetFirstResult(i) .SetMaxResults(1) .List<Customer>(); // always contains first entity regardless of SetFirstResult value (when stateless session used) } finally { s.Close(); } } > paged join fetch with OpenStatelessSession always results the same rows regardless of SetFirstRow parameter > ----------------------------------------------------------------------------------------------------------- > > Key: NH-2676 > URL: http://216.121.112.228/browse/NH-2676 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Mariusz Florek > Priority: Major > Attachments: Domain-Customer.zip > > > I tested results of HQL query using standard and stateless session: > from Customer c > join fetch c.Orders as o > left join fetch o.OrderLines as ol > join fetch ol.Product p > order by c.CompanyName > I tried to limit result count using SetFirstResult(...) and SetMaxResults(...) on IQuery object. > For test I used MsSql2008DialectLinqReadonlyCreateScript.sql from NHibernate 3.1.0-GA zip with binaries. > With standard session I got proper results - with stateless session I always got first N (set with SetMaxResults) objects regardless of value set with SetFirstResult. > Additionally query ran with stateless session consumed twice execution time (although I expected it to be faster). > Problem exists also with simpler join example: > from Customer c > join fetch c.Orders > order by c.CompanyName > BTW - how NHibernate process such queries (how resolves page to read - I can see only not limited SQL generated)? > Cheers, > Mariusz -- 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-04-26 11:58:54
|
[ http://216.121.112.228/browse/NH-2675?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo closed NH-2675. --------------------------- Resolution: Not an Issue This is not the place to know "how" or ask for help. Please send your questions to the nhusers group. > Problem in passing user defined data type to stored procedure as parameter > -------------------------------------------------------------------------- > > Key: NH-2675 > URL: http://216.121.112.228/browse/NH-2675 > Project: NHibernate > Issue Type: Bug > Components: DataProviders / Dialects > Affects Versions: 3.0.0.GA > Reporter: Anupam Mishra > > HI I am using NHibernate30.As per our requirement we need to send User Defined data type(i.e Custom Data Type ) as a parameter to stored procedure.With ADO.net this is working > following are my Stored Procedure,Type and domain Object . > > *************Store Procedure**************** > create or replace > PROCEDURE odp_varray_sample_proc(p_cursor out SYS_REFCURSOR,param IN odp_varray_sample_type) > IS > BEGIN > FOR > counter IN 1..3 > LOOP > insert into temp_tran (emp_id, emp_name, emp_password, team_associated_with,IS_CAPTAIN,NO_OF_MOM,BALANCE) > SELECT EMP_ID,EMP_NAME,EMP_PASSWORD,TEAM_ASSOCIATED_WITH, > IS_CAPTAIN,NO_OF_MOM,BALANCE FROM employee WHERE EMP_ID=param(counter); > end LOOP; > open p_cursor for select * from temp_tran; > delete from temp_tran; > END odp_varray_sample_proc; > *****End Stored Procedure********************** > **TYpe in Database Oracle*********** > create or replace type odp_varray_sample_type as varray(3000) of number; > ****End Type in Database Oracle****** > *****Domain Object***************************** > public class odp_varray_sample_type : NHibernate.Type.ImmutableType > { > public Int64[] int_array; > public odp_varray_sample_type() > : base(new NHibernate.SqlTypes.SqlType(System.Data.DbType.Object)) > { > } > public odp_varray_sample_type(Int64[] array) > : base(new NHibernate.SqlTypes.SqlType(System.Data.DbType.Object)) > { > this.int_array = array; > } > public override object FromStringValue(string xml) > { > return xml.ToString(); > } > public override object Get(System.Data.IDataReader rs, string name) > { > return name.ToString(); > } > public override object Get(System.Data.IDataReader rs, int index) > { > return index.ToString(); > } > public override void Set(System.Data.IDbCommand cmd, object value, int index) > { > OracleCommand orclCmd = (OracleCommand)cmd; > > orclCmd.Parameters[index].OracleDbType > = OracleDbType.Int64; > orclCmd.Parameters[index].CollectionType > = OracleCollectionType.PLSQLAssociativeArray; > orclCmd.Parameters[index].Value = value; > } > public override string ToString(object val) > { > return val.ToString(); > } > public override string Name > { > get > { > return Name; > } > } > public override Type ReturnedClass > { > get > { > return this.GetType(); > } > } > } > *****END Domain Object***************************** > Error coming as > Wrong number of argument or type.Please help. -- 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-04-26 11:57:03
|
[ http://216.121.112.228/browse/NH-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20965#action_20965 ] Fabio Maulo commented on NH-2676: --------------------------------- How recreate the case you are talking about ? > paged join fetch with OpenStatelessSession always results the same rows regardless of SetFirstRow parameter > ----------------------------------------------------------------------------------------------------------- > > Key: NH-2676 > URL: http://216.121.112.228/browse/NH-2676 > Project: NHibernate > Issue Type: Bug > Components: Core > Affects Versions: 3.1.0 > Reporter: Mariusz Florek > Priority: Major > > I tested results of HQL query using standard and stateless session: > from Customer c > join fetch c.Orders as o > left join fetch o.OrderLines as ol > join fetch ol.Product p > order by c.CompanyName > I tried to limit result count using SetFirstResult(...) and SetMaxResults(...) on IQuery object. > For test I used MsSql2008DialectLinqReadonlyCreateScript.sql from NHibernate 3.1.0-GA zip with binaries. > With standard session I got proper results - with stateless session I always got first N (set with SetMaxResults) objects regardless of value set with SetFirstResult. > Additionally query ran with stateless session consumed twice execution time (although I expected it to be faster). > Problem exists also with simpler join example: > from Customer c > join fetch c.Orders > order by c.CompanyName > BTW - how NHibernate process such queries (how resolves page to read - I can see only not limited SQL generated)? > Cheers, > Mariusz -- 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: Mariusz F. (JIRA) <nh...@gm...> - 2011-04-26 09:20:53
|
paged join fetch with OpenStatelessSession always results the same rows regardless of SetFirstRow parameter ----------------------------------------------------------------------------------------------------------- Key: NH-2676 URL: http://216.121.112.228/browse/NH-2676 Project: NHibernate Issue Type: Bug Components: Core Affects Versions: 3.1.0 Reporter: Mariusz Florek Priority: Major I tested results of HQL query using standard and stateless session: from Customer c join fetch c.Orders as o left join fetch o.OrderLines as ol join fetch ol.Product p order by c.CompanyName I tried to limit result count using SetFirstResult(...) and SetMaxResults(...) on IQuery object. For test I used MsSql2008DialectLinqReadonlyCreateScript.sql from NHibernate 3.1.0-GA zip with binaries. With standard session I got proper results - with stateless session I always got first N (set with SetMaxResults) objects regardless of value set with SetFirstResult. Additionally query ran with stateless session consumed twice execution time (although I expected it to be faster). Problem exists also with simpler join example: from Customer c join fetch c.Orders order by c.CompanyName BTW - how NHibernate process such queries (how resolves page to read - I can see only not limited SQL generated)? Cheers, Mariusz -- 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: Anupam M. (JIRA) <nh...@gm...> - 2011-04-26 05:30:55
|
Problem in passing user defined data type to stored procedure as parameter -------------------------------------------------------------------------- Key: NH-2675 URL: http://216.121.112.228/browse/NH-2675 Project: NHibernate Issue Type: Bug Components: DataProviders / Dialects Affects Versions: 3.0.0.GA Reporter: Anupam Mishra HI I am using NHibernate30.As per our requirement we need to send User Defined data type(i.e Custom Data Type ) as a parameter to stored procedure.With ADO.net this is working following are my Stored Procedure,Type and domain Object . *************Store Procedure**************** create or replace PROCEDURE odp_varray_sample_proc(p_cursor out SYS_REFCURSOR,param IN odp_varray_sample_type) IS BEGIN FOR counter IN 1..3 LOOP insert into temp_tran (emp_id, emp_name, emp_password, team_associated_with,IS_CAPTAIN,NO_OF_MOM,BALANCE) SELECT EMP_ID,EMP_NAME,EMP_PASSWORD,TEAM_ASSOCIATED_WITH, IS_CAPTAIN,NO_OF_MOM,BALANCE FROM employee WHERE EMP_ID=param(counter); end LOOP; open p_cursor for select * from temp_tran; delete from temp_tran; END odp_varray_sample_proc; *****End Stored Procedure********************** **TYpe in Database Oracle*********** create or replace type odp_varray_sample_type as varray(3000) of number; ****End Type in Database Oracle****** *****Domain Object***************************** public class odp_varray_sample_type : NHibernate.Type.ImmutableType { public Int64[] int_array; public odp_varray_sample_type() : base(new NHibernate.SqlTypes.SqlType(System.Data.DbType.Object)) { } public odp_varray_sample_type(Int64[] array) : base(new NHibernate.SqlTypes.SqlType(System.Data.DbType.Object)) { this.int_array = array; } public override object FromStringValue(string xml) { return xml.ToString(); } public override object Get(System.Data.IDataReader rs, string name) { return name.ToString(); } public override object Get(System.Data.IDataReader rs, int index) { return index.ToString(); } public override void Set(System.Data.IDbCommand cmd, object value, int index) { OracleCommand orclCmd = (OracleCommand)cmd; orclCmd.Parameters[index].OracleDbType = OracleDbType.Int64; orclCmd.Parameters[index].CollectionType = OracleCollectionType.PLSQLAssociativeArray; orclCmd.Parameters[index].Value = value; } public override string ToString(object val) { return val.ToString(); } public override string Name { get { return Name; } } public override Type ReturnedClass { get { return this.GetType(); } } } *****END Domain Object***************************** Error coming as Wrong number of argument or type.Please help. -- 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: Rostislav P. (JIRA) <nh...@gm...> - 2011-04-25 21:15:48
|
QueryOver doesn't have support for entity-name ---------------------------------------------- Key: NH-2674 URL: http://216.121.112.228/browse/NH-2674 Project: NHibernate Issue Type: New Feature Components: QueryOver Affects Versions: 3.2.0Alpha2 Reporter: Rostislav Pridatko Priority: Minor We're currently using ICriteria in our project and we liked the new QueryOver syntax and want to use it throughout the project. Currently the main showstopper for us is the lack of support for entity-name in QueryOver. I've read the following discussion here: https://groups.google.com/group/nhusers/browse_thread/thread/de9df28b4cb57985?pli=1 and we have exactly the same situation in our project - we have one POCO class but several maps for it and we use entity-name to switch to a proper database table/view at run time. I looked at the code in trunk of NHibernate and looks like adding support for entity-name in QueryOver should be pretty easy and should not affect existing code. We'll just need to add one method overload to NHibernate.Impl.SessionImpl (and ISession): public IQueryOver<T, T> QueryOver<T>(string entityName) where T : class { using (new SessionIdLoggingContext(SessionId)) { CheckAndUpdateSessionStatus(); return new QueryOver<T, T>(new CriteriaImpl(entityName, this)); } } and another one to NHibernate.Criterion.QueryOver: public static QueryOver<T, T> Of<T>(string entityName) { return new QueryOver<T, T>(new CriteriaImpl(entityName, null)); } I may be missing something here; is this lack of support for entity-name in QueryOver an intentional decision or is it just something that no one ever got to due to lack of time? Can I create and upload a patch or do I need some extra permissions here? Sorry for bothering you with questions, couldn't find any FAQ or policy on how to contribute to the project. Thanks. -- 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-04-25 21:13:49
|
[ http://216.121.112.228/browse/NH-2505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2505. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > Querries with WHERE containing SQL Server 'bit' datatype produce CASE construction > ---------------------------------------------------------------------------------- > > Key: NH-2505 > URL: http://216.121.112.228/browse/NH-2505 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Alexei Shcherbakov > Priority: Minor > Fix For: 3.2.0Alpha3 > > > LINQ construction .Where( xxx => ( xxx.Alive == false ) ) > produce SQL > case when player1_.Alive=1 then ''true'' else ''false'' end=case when @p2=''true'' then ''true'' else ''false'' end > Param @p2 sets like @p2=N'False' > I think the resulting SQL WHERE construction must be player1_.Alive=@p2 and param @p2 sets @p2=1 or 0 -- 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-04-25 20:16:48
|
[ http://216.121.112.228/browse/NH-2673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2673: ---------------------------- Priority: Minor (was: Blocker) > 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 > 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: Josef H. (JIRA) <nh...@gm...> - 2011-04-25 18:05:53
|
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: Blocker 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-04-25 14:17:47
|
[ http://216.121.112.228/browse/NH-2505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo updated NH-2505: ---------------------------- Description: LINQ construction .Where( xxx => ( xxx.Alive == false ) ) produce SQL case when player1_.Alive=1 then ''true'' else ''false'' end=case when @p2=''true'' then ''true'' else ''false'' end Param @p2 sets like @p2=N'False' I think the resulting SQL WHERE construction must be player1_.Alive=@p2 and param @p2 sets @p2=1 or 0 was: LINQ construction .Where( xxx => ( xxx.Alive == false ) ) produce SQL case when player1_.Alive=1 then ''true'' else ''false'' end=case when @p2=''true'' then ''true'' else ''false'' end Param @p2 sets like @p2=N'False' I think the resulting SQL WHERE construction must be player1_.Alive=@p2 and param @p2 sets @p2=1 or 0 Issue Type: Improvement (was: Bug) It is not a bug since the query returns right results (in the trunk). The "case" clause is unneeded. > Querries with WHERE containing SQL Server 'bit' datatype produce CASE construction > ---------------------------------------------------------------------------------- > > Key: NH-2505 > URL: http://216.121.112.228/browse/NH-2505 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.GA > Reporter: Alexei Shcherbakov > Priority: Minor > > LINQ construction .Where( xxx => ( xxx.Alive == false ) ) > produce SQL > case when player1_.Alive=1 then ''true'' else ''false'' end=case when @p2=''true'' then ''true'' else ''false'' end > Param @p2 sets like @p2=N'False' > I think the resulting SQL WHERE construction must be player1_.Alive=@p2 and param @p2 sets @p2=1 or 0 -- 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-04-25 13:48:47
|
[ http://216.121.112.228/browse/NH-2551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fabio Maulo resolved NH-2551. ----------------------------- Resolution: Fixed Fix Version/s: 3.2.0Alpha3 > Bad code practice. Function SessionFactoryImpl.GetImplementors: if type not found - value from ReflectHelper.ClassForFullName returns through TypeLoadException. > ---------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: NH-2551 > URL: http://216.121.112.228/browse/NH-2551 > Project: NHibernate > Issue Type: Improvement > Components: Core > Affects Versions: 3.0.0.GA > Reporter: Michael F. > Priority: Major > Fix For: 3.2.0Alpha3 > > > Function NHibernate.DLL!NHibernate.Util.ReflectHelper.ClassForFullName(string classFullName) Line 222 > NHibernate.DLL!NHibernate.Impl.SessionFactoryImpl.GetImplementors(string className) Line 616 > to reproduce in VS2010 > 1. VS2010: set checkbox in menu Debug->Exceptions->Common language runtime exceptions->Thrown > 2. try run standard test from a solution in debug mode: > NHibernate.Test.Linq.ByMethod.AnyTests.AnySublist() > 3. System.TypeLoadException will be thrown. -- 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 |