|
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: 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 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: 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: 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
|