[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] Created: (HHH-6960) NullPointerException in PreCollectionRemove Listener
by Kevin Jordan (JIRA)
NullPointerException in PreCollectionRemove Listener
----------------------------------------------------
Key: HHH-6960
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6960
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 4.0.0.Final
Environment: Hibernate 4.0.0 to MySQL
Reporter: Kevin Jordan
I'm getting a NullPointerException on line 47 of EnversPreCollectionRemoveEventListenerImpl very consistently. I wasn't sure if it was due to lazy collections or not, but it seems that it fails if they're eagerly fetched or lazily fetched. I'm guessing it has something to do with getLoadedPersister() returning a null value since the comments for it say "This is only available late during the flush cycle". The stack trace is
Quote:
java.lang.NullPointerException
at org.hibernate.envers.event.EnversPreCollectionRemoveEventListenerImpl.onPreRemoveCollection(EnversPreCollectionRemoveEventListenerImpl.java:47)
at org.hibernate.action.internal.CollectionRemoveAction.preRemove(CollectionRemoveAction.java:143)
at org.hibernate.action.internal.CollectionRemoveAction.execute(CollectionRemoveAction.java:104)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:273)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:265)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:188)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:323)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1081)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:315)
at org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)
at org.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:73)
... 120 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 8 months