|
Mondays Monday, May 16, 2005
A new exception to start the day
0 Comments:java.sql.SQLException: Fail to convert to internal representation This morning after a CVS update my app starts giving this exception trying to get some data. FYI, my app is using Spring->Hibernate->Oracle A google search (always the first thing with strange errors) shows a bunch of posts with replies telling people to use prepared statements instead of string hoodoo-voodoo. Well, I'm using hibernate, so this doesn't apply. suck. A quick check shows the hibernate config and the value object still match-up (woohoo, my co-workers aren't conspiring against me). Well, the next thing is to actually *read* the stack trace ;) So, I see some interesting lines: at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:226) at oracle.jdbc.driver.CharCommonAccessor.getBigDecimal(CharCommonAccessor.java:324) at oracle.jdbc.driver.CharCommonAccessor.getBoolean(CharCommonAccessor.java:157) at oracle.jdbc.driver.OracleResultSetImpl.getBoolean(OracleResultSetImpl.java:394) at oracle.jdbc.driver.OracleResultSet.getBoolean(OracleResultSet.java:1570) at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getBoolean(WSJdbcResultSet.java:686) at net.sf.hibernate.type.BooleanType.get(BooleanType.java:19) Well, I've only got a few fields that are booleans, this should be easy to trace down. The exception also points out that Oracle is expecting the booleans to really be BigDecimals. So, time to look at the database. Aha, they are consipring against me (jk), the columns have misteriously been changed to varchars. Gently abuse the dba, and all is well in the world again. Now if I could only stop them from changing my checked exceptions to unchecked ones.... <willCode4Beer/> posted at 10:44 AM permalink
|
Contributors
Under the Wheel
Behind the Wheel
|
