Hello,
I have trouble with the new 3.2.2 release and POJOs with activated rowid in the mapping.
On session.update() or .merge() I´m getting a IndexOutOfBoundsException for System.arraycopy(..) in the method
org.hibernate.persister.AbstractEntityPersister.getSQLUpdateByRowIdString()
May be it´s a bug.
protected String[] getSQLUpdateByRowIdStrings() {
if ( sqlUpdateByRowIdString == null ) {
throw new AssertionFailure( "no update by row id" );
}
String[] result = new String[getTableSpan()];
result[0] = sqlUpdateByRowIdString;
System.arraycopy( sqlUpdateStrings, 1, result, 1, getTableSpan() );
return result;
}
In my case "getTableSpan()" returns 1, so result[] has only index 0 and a arraycopy starting at position 1 is simply wrong!
In 3.2.1 there was a for-loop instead of system.arraycopy(..)
for ( int i = 1; i < getTableSpan(); i++ ) {
result[i] = sqlUpdateStrings[i];
}
With getTableSpan()=1 the loop was not entered and no exception occurs.
Are you agree that we can call this a bug?
Hibernate version: 3.2.2
Mapping documents: rowid must be activated
Full stack trace of any exception that occurs: IndexOutOfBoundsException
Name and version of the database you are using: Oracle 10.2
|