i am using Hibernate and got the exception ArrayIndexOutOfBoundsException what are the possible causes?
You access some index out of the array size. For example, myArray.get(-1);
You are indexing an array with an index out of the size of the Array. It has to do nothing with hibernate.
Check in your code that the index
variable is lower than array.size()
You have tried to access an index which is out of your array size i.e. index < 0 or index >= array.length
.
For example int[] myArray = new int[10];
if you access myArray[11]
you will get ArrayIndexOutOfBoundsException
It's possible that hibernate is throwing this exception in the case, you use a old jdbc driver with oracle. At some point there was a bug in the jdbc diver with the fetch-size, meaning that if the fetch-size you use in hibernate (hibernate.properties or in hibernate.cfg.xml) was not the same than in jdbc-level you got an ArrayIndexOutOfBoundsException.