Re: calling stored procedures

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Apr 09 2005 - 15:12:14 EDT

  • Next message: Andrus Adamchik: "Re: transactions, row locking, race condition?"

    Recently I discovered and fixed some problems in handling stored
    procedures by PostgresAdapter -
    http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-299

    However your issue doesn't seem related. The error is coming from
    PostgreSQL side, not Cayenne (PostgreSQL has an annoying habit of
    calling all database objects "relations" adding to confusion).

    A random suggestion - can you try removing schema part from procedure
    definition. "public" schema should resolve implicitly.

    Andrus

    On Apr 9, 2005, at 1:51 PM, tnaki..ofthome.net wrote:

    > I'm having a lot of trouble making a call to a stored procedure (named
    > "anketirani"). The procedure takes no parameters and returns a value
    > (RETURN myvalue; at the end of the Pl/pgSQL procedure).
    > This is the relevant part of my map file:
    > <procedure name="anketirani" schema="public" returningValue="true">
    > <procedure-parameter name="returnValue" type="INTEGER"
    > direction="out"/>
    > </procedure>
    > I call the procedure like so:
    > ProcedureQuery query = new ProcedureQuery("anketirani");
    > List performQuery = kontekst.performQuery(query);
    > The exception along with the interesting part of the stack trace is
    > pasted below.
    > After reading the relevant parts of the user manual over and over
    > again, I'm still at a loss.
    >
    > Thanks,
    > Tomislav
    >
    > org.objectstyle.cayenne.CayenneRuntimeException
    > [v.1.2M1 November 21 2004] Query exception.
    > unlabeledMessage: Query exception.
    > java.sql.SQLException
    > ERROR: relation "public.anketirani" does not exist
    > SQLState: 42P01
    > errorCode: 0
    > Stack Trace:
    >
    > *
    > org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExec
    > utorImpl.java:1471)
    >
    > *
    > org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorIm
    > pl.java:1256)
    >
    > *
    > org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java
    > :175)
    >
    > *
    > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statem
    > ent.java:388)
    >
    > *
    > org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJd
    > bc2Statement.java:329)
    >
    > *
    > org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statem
    > ent.java:320)
    >
    > *
    > org.objectstyle.cayenne.access.DataNode.runStoredProcedure(DataNode.jav
    > a:640)
    >
    > *
    > org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:
    > 345)
    >
    > *
    > org.objectstyle.cayenne.access.DataDomain.performQueries(DataDomain.jav
    > a:654)
    >
    > *
    > org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    > ava:1408)
    >
    > *
    > org.objectstyle.cayenne.access.Transaction.performQueries(Transaction.j
    > ava:179)
    >
    > *
    > org.objectstyle.cayenne.access.DataContext.performQueries(DataContext.j
    > ava:1366)
    >
    > *
    > org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    > a:1622)
    >
    > *
    > org.objectstyle.cayenne.access.DataContext.performQuery(DataContext.jav
    > a:1485)
    >
    > * netgen.anketa.sucelje.Home.dohvatiSlijedecuOsobu2(Home.java:92)
    >
    >



    This archive was generated by hypermail 2.0.0 : Sat Apr 09 2005 - 15:12:20 EDT