OrderBy() generates an Error -9700: java.sql.SQLException: Routine (upper) ambiguous - more than one routine resolves to given signature.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

OrderBy() generates an Error -9700: java.sql.SQLException: Routine (upper) ambiguous - more than one routine resolves to given signature.

rdblaha1
I am attempting to use OrderBy() in my entity class. According to documentation ( Persistence Javadoc OrderBy ) quote:

"If the ordering element is not specified, ordering by the primary key of the associated entity is assumed. "

This looked simple enough.  My primary key has two elements to it.  After building and deploying my program when I run the code that expects to use the OrderBy it crashes.  My information is given below.  

(I have attempted to strip out the unnecessary parts of my code and otherwise minimize the information needed to demonstrate the problem I am having.)

Code in entity class:

     Tripname entity:
        @OneToMany(cascade = CascadeType.ALL, mappedBy = "tripname")
        @OrderBy( )
        private List<Trip> tripList;

      TripPK
        @Basic(optional = false)
        @Column(name = "trip_id")
        private int tripId;
        @Basic(optional = false)
        @Column(name = "trip_stop")
        private int tripStop;

Browswer failure display:

HTTP Status 500 -

type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException:
Internal Exception: java.sql.SQLException: Routine (upper) ambiguous - more than one routine resolves to given signature.
Error Code: -9700
Call: SELECT trip_approval, trip_stop, trip_id, UPPER(trip_id), UPPER(trip_stop) FROM trip WHERE (trip_id = ?) ORDER BY UPPER(trip_id) ASC, UPPER(trip_stop) ASC
        bind => [5]
Query: ReadAllQuery(com.davisco.ts.persist.Trip)

root cause

Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Routine (upper) ambiguous - more than one routine resolves to given signature.
Error Code: -9700
Call: SELECT trip_approval, trip_stop, trip_id, UPPER(trip_id), UPPER(trip_stop) FROM trip WHERE (trip_id = ?) ORDER BY UPPER(trip_id) ASC, UPPER(trip_stop) ASC
        bind => [5]
Query: ReadAllQuery(com.davisco.ts.persist.Trip)

root cause

java.sql.SQLException: Routine (upper) ambiguous - more than one routine resolves to given signature.

note The full stack traces of the exception and its root causes are available in the Sun GlassFish Enterprise Server v2.1 logs.
Sun GlassFish Enterprise Server v2.1



And the server.log file:

SELECT trip_approval, trip_stop, trip_id, UPPER(trip_id), UPPER(trip_stop) FROM trip WHERE (trip_id = ?) ORDER BY UPPER(trip_id) ASC, UPPER(trip_stop) ASC
        bind => [5]
Local Exception Stack:
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Routine (upper) ambiguous - more than one routine resolves to given signature.
Error Code: -9700
Call: SELECT trip_approval, trip_stop, trip_id, UPPER(trip_id), UPPER(trip_stop) FROM trip WHERE (trip_id = ?) ORDER BY UPPER(trip_id) ASC, UPPER(trip_stop) ASC
        bind => [5]
Query: ReadAllQuery(com.davisco.ts.persist.Trip)
        at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:319)



As far as I can tell I did exactly what the Documentation told me to do. I guess that the failure is that I am using a larger than one element Primary Key.  I am finding no information on use more than one element in my Primary Key to work with the OrderBy annotation.

I am finding little information on the "Routine (upper) ambiguous" error message.  Please point me to the documenation I am missing, or better yet point out the obvious error in my code or use.  Thank you.