[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [eclipselink-users] Class cast exception callingoraclestoredprocedure by @NamedStoredProcedureQuery
|
Good point, I've removed the try/catch and get the following.
[EL Fine]: 2009.02.06 09:37:19.017--Connection(16419067)--BEGIN
YETAXAPP.REFRESH_UNITS_HELD(); END;
[EL Warning]: 2009.02.06 09:37:43.737--java.lang.ClassCastException:
oracle.jdbc.driver.OraclePreparedStatement cannot be cast to
java.sql.CallableStatement
Exception in thread "Thread-6" java.lang.ClassCastException:
oracle.jdbc.driver.OraclePreparedStatement cannot be cast to
java.sql.CallableStatement
at
org.eclipse.persistence.internal.databaseaccess.DatabasePlatform.execute
StoredProcedure(DatabasePlatform.java:1681)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicEx
ecuteCall(DatabaseAccessor.java:567)
at
org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.execute
Call(DatabaseAccessor.java:500)
at
org.eclipse.persistence.sessions.server.ServerSession.executeCall(Server
Session.java:522)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.ex
ecuteCall(DatasourceCallQueryMechanism.java:204)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.ex
ecuteCall(DatasourceCallQueryMechanism.java:190)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.ex
ecuteSelectCall(DatasourceCallQueryMechanism.java:261)
at
org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.ex
ecuteSelect(DatasourceCallQueryMechanism.java:243)
at
org.eclipse.persistence.queries.ResultSetMappingQuery.executeDatabaseQue
ry(ResultSetMappingQuery.java:203)
at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java
:666)
at
org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(Databa
seQuery.java:585)
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecute
Query(UnitOfWorkImpl.java:2587)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(A
bstractSession.java:1178)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(A
bstractSession.java:1162)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(A
bstractSession.java:1136)
at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(A
bstractSession.java:1118)
at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.executeReadQuery(EJBQu
eryImpl.java:399)
at
org.eclipse.persistence.internal.jpa.EJBQueryImpl.getResultList(EJBQuery
Impl.java:517)
at
com.mgl.yearendtax.datamodel.dao.impl.YeAssetsDAO.refreshUnitsHeld(YeAss
etsDAO.java:137)
at
com.mgl.yearendtax.userinterface.application.handlers.RefreshUnitsHeld$1
.run(RefreshUnitsHeld.java:20)
at java.lang.Thread.run(Thread.java:619)
Also interesting point, the call ran for a while before the error was
thrown so I added a commit to the stored proc and it does complete
correctly. The only issue here is, I guess, the return value. However no
return value is sent. Also I've checked that OraclePreparedStatement is
not used at any point in my code so I'm guessing there's a default to
OraclePreparedStatement somewhere within eclipselink(?).
-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx
[mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of James
Sutherland
Sent: Friday, 6 February 2009 12:54 AM
To: eclipselink-users@xxxxxxxxxxx
Subject: RE: [eclipselink-users] Class cast exception
callingoraclestoredprocedure by @NamedStoredProcedureQuery
There is no EclipseLink or JPA or you stack (JPA is not a thing, just a
spec, you use a JPA provider, not JPA).
You are throwing the exception from,
com.mgl.yearendtax.datamodel.dao.impl.YeAssetsDAO.refreshUnitsHeld(YeAss
etsDAO.java:142)
Looks like you are trapping some exception and throwing your own error,
you need to set the cause, or throw/log the original error. You can
also enable EclipseLink logging and it will dump any errors, assuming
you are using EclipseLink.
NOTICE
This e-mail and any attachments are confidential and may contain copyright material of Macquarie Group Limited or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Group Limited does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Group Limited.