[Hibernate-JIRA] Created: (HHH-6950) Bogus string replacement in SQLServer2005Dialect.insertRowNumberFunction()
by Roberto Italia (JIRA)
Bogus string replacement in SQLServer2005Dialect.insertRowNumberFunction()
--------------------------------------------------------------------------
Key: HHH-6950
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6950
Project: Hibernate Core
Issue Type: Bug
Components: core, query-sql
Affects Versions: 4.0.0.Final
Environment: Hibernate 4.0.0, SQLServer 2008R2
Reporter: Roberto Italia
The fix for HHH-6849 introduced a problem with column-names containing the character sequence 'from'.
For example, assume the string builder contains the following query before the call to SQLServer2005Dialect.insertRowNumberFunction() (formatted for better reading):
select persistent0_.rid as rid1688_,
persistent0_.deviationfromtarget as deviati16_1688_,
persistent0_.sortindex as sortindex1688_
from m_evalstate persistent0_
where persistent0_.customerid=?
After the call to SQLServer2005Dialect.insertRowNumberFunction(), the string builder contains:
select persistent0_.rid as rid1688_,
persistent0_.deviatio,
ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __hibernate_row_nr__nfromtarget as deviati16_1688_,
persistent0_.sortindex as sortindex1688_
from m_evalstate persistent0_
where persistent0_.customerid=?
But the intention of the fix was:
select persistent0_.rid as rid1688_,
persistent0_.deviationfromtarget as deviati16_1688_,
persistent0_.sortindex as sortindex1688_,
ROW_NUMBER() OVER (ORDER BY CURRENT_TIMESTAMP) as __hibernate_row_nr__
from m_evalstate persistent0_
where persistent0_.customerid=?
A fix would be the following code instead of the current:
final String myFrom = " " + FROM + " ";
int selectEndIndex = sql.indexOf( myFrom );
sql.insert( selectEndIndex, ", ROW_NUMBER() OVER (" + orderby + ") as __hibernate_row_nr__" );
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months
[Hibernate-JIRA] Commented: (HHH-1775) collection batch fetching
by Guenther Demetz (JIRA)
[ https://hibernate.onjira.com/browse/HHH-1775?page=com.atlassian.jira.plug... ]
Guenther Demetz commented on HHH-1775:
--------------------------------------
https://github.com/hibernate/hibernate-orm/pull/337
> collection batch fetching
> -------------------------
>
> Key: HHH-1775
> URL: https://hibernate.onjira.com/browse/HHH-1775
> Project: Hibernate ORM
> Issue Type: Improvement
> Components: core
> Reporter: Steve Ebersole
> Assignee: Steve Ebersole
> Priority: Minor
> Fix For: hql+collection
>
>
> I have code local on my box to support "peeking" into the second level cache when determining whether to add a particular entity/collection key to a batch load request. If the given key is contained in the second level cache, then do not batch fetch the entity/collection as it will be initialized from second level cache on access.
> However, there are still large inefficiencies when performing this for collections; the biggest of which currently is the fact that we retreive a IdentityMap.entrySet for each and ever call to determine a collectiomn fetch batch. For performance reasons, we should align this with how entity batches are handled where the entity keys considered to be "batch loadable" are tracked seperately on the BatchFetchQueue.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months