Problem with Transaction

Поиск
Список
Период
Сортировка
От Eduardo Muñoz
Тема Problem with Transaction
Дата
Msg-id 20060308165936.1706.qmail@web36215.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: Problem with Transaction  (Jan de Visser <jdevisser@digitalfairway.com>)
Список pgsql-general
Hi, I'm trying to make a PL/pgSQL function to update
or insert if the row is not present. I tested the
function and it works fine, but when I call it through
JDBC, it executes, but the row is not inserted or
updated. This is my JDBC code.

        try{

connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
            connection.setAutoCommit(false);
            statement = connection.prepareCall("{? =
call save(?,?,?)}");
            statement.registerOutParameter(1,
Types.INTEGER);
            statement.setObject(2, null);
            statement.setObject(3, null);
            statement.setObject(4, "1234");
            statement.executeUpdate();
            id = (Integer)statement.getObject(1);
            connection.commit();
        } catch(SQLException e){
            try{
                connection.rollback();
            } catch(SQLException e2){
                e2.printStackTrace();
            }
            e.printStackTrace();
        }

I am getting the following exception:
org.postgresql.util.PSQLException: ERROR: function
save("unknown", "unknown", character varying) does not
exist
    at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
    at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
    at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346)
    at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:297)
    ...



__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Errors ignored on restore
Следующее
От:
Дата:
Сообщение: