Thanks Michael. - I tried this, but to no avail. As you can see from the program below, I carry out 100.000 inserts without reproducing the error. Has anyone got any other ideas about why Hibernate fails to insert doubles even though doubles can be inserted without problems through jdbc?
My entity is a bean containing a mix of Integer, Float and Double properties, and I use the default mappings.
This is really a hard one to crack. Thanks for your time...
Randahl
PreparedStatement preparedStatement = connection.prepareStatement(
"insert into double_test " +
"values (?, ?)"
);
for(int i = 0; i < 100000; i++) {
double f = random.nextDouble();
if(random.nextBoolean())
f *= -1;
int exp = random.nextInt(30);
f *= Math.pow(10, exp);
preparedStatement.setInt(1, i);
preparedStatement.setDouble(2, f);
preparedStatement.execute();
}
|