From: | Eduardo Muñoz <eduardomc_79(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Problem with Transaction |
Date: | 2006-03-08 16:59:36 |
Message-ID: | 20060308165936.1706.qmail@web36215.mail.mud.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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/
From | Date | Subject | |
---|---|---|---|
Next Message | sunithab | 2006-03-08 17:10:39 | distance calculation usng lat and long in miles |
Previous Message | Tom Lane | 2006-03-08 16:24:12 | Re: Errors ignored on restore |