I have attached the full stack trace below. When C3P0 is enabled in the hibernate configuration file, the exception is thrown. When C3P0 is not used, everything works fine. It seems as though the nullSafeSet method of the JGeometryType custom user type (thanks for posting that by the way, works great!) creates its own connection and C3P0 gets angry and starts blurting out protocol corrections : )
If anyone has encountered this, any info would be most appreciated. I am not versed in the finer points of C3P0, so if this is ignorant I apologize in advance.
Hibernate version: Hibernate 3.2.3
Full stack trace of any exception that occurs:
java.lang.ClassCastException: com.mchange.v2.c3p0.impl.NewProxyConnection cannot be cast to oracle.jdbc.driver.OracleConnection
at ...persistence.JGeometryType.nullSafeSet(Unknown Source)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:156)
at org.hibernate.loader.Loader.bindNamedParameters(Loader.java:1753)
at org.hibernate.loader.Loader.bindParameterValues(Loader.java:1679)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1563)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at ....hibernate.**HibernateDAO.findByGeography(Unknown Source)
at ....command.LookupCommand.execute(Unknown Source)
at ....CommandHandlerBean.executeCommand(Unknown Source)
at ....test.ILSTester.geoLookup(Unknown Source)
at ....test.ILSTester.main(Unknown Source)
Name and version of the database you are using:Oracle 10g R2
|