-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: About SQLServer2005Dialect and SQLServer2008Dialect
PostPosted: Fri Aug 24, 2012 7:16 am 
Newbie

Joined: Fri Aug 24, 2012 6:57 am
Posts: 1
This post is just to info about a wrong behavior using SQLServer2008Dialect.

Context:
- SQL Server 2008 Express
- Microsoft SQL JDBC 4
- Hibernate 3.6.5
- I have created a pagination method, so I'm using 'setFirstResult' and 'setMaxResults' to obtain the desired items from SQL Server 2008 database.


When using 'SQLServer2008Dialect', the resulting query looks like:

SELECT TOP xxx myFields FROM myTable;

So, while xxx is higher, the performance dropdowns and pagination becomes a hell for users... so it becomes a hell for me ;-)


I tried 'SQLServer2005Dialect', and the performance got much better, and now the query looks like:

WITH query AS (select
ROW_NUMBER() OVER (
ORDER BY
CURRENT_TIMESTAMP) as __hibernate_row_nr__,
myFields
from
myTable this_
where
1=1) SELECT
*
FROM
query
WHERE
__hibernate_row_nr__ BETWEEN ? AND ?


So I was wondering why the older dialect is working better than new... and I saw the newest 'SQLServer2008Dialect' is inheriting from the oldest 'SQLServerDialect' while 'SQLServer2005Dialect' is correcting this problem...

I think 'SQLServer2008Dialect' should inherit from 'SQLServer2005Dialect' on future releases.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.