JDBC: pl/pgsql function runs but does not do anything

From: Rob W <digital_illuminati(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: JDBC: pl/pgsql function runs but does not do anything
Date: 2009-07-13 14:23:27
Message-ID: 806276.32534.qm@web34607.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


I have a PL/pgsql function called "move_records" that does not take any parameters and does not return any results. It performs inserts on a few tables (as the name suggests, it copies records from one table to another).

When I run this function using pgAdminIII's query window, using the command "select move_records()", it executes correctly and as expected.

However, when I call the function via JDBC, it runs, but appears to do nothing. It's as if nothing it does is getting committed. The relevant Java code is:

CallableStatement statement = connection.prepareCall("{call move_records()}");
statement.execute();

At first I thought it was not running at all, so I put in "RAISE INFO" statements to see if it was actually working -- and those did indeed print statements. So I know for sure it is actually running. I tried commenting out different things in case it was failing silently, but that made no difference. Running the stored procedure does not return any errors or warnings.

There must be something really obvious I'm overlooking?

Any help would be greatly appreciated!

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message John DeSoi 2009-07-13 14:37:32 Re: JDBC: pl/pgsql function runs but does not do anything
Previous Message Bryan Nuse 2009-07-13 00:33:07 presence/absence