Skip site navigation (1) Skip section navigation (2)

Re: Newby Question - accessing refcursor.

From: burferd <jarzabek(at)pobox(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Newby Question - accessing refcursor.
Date: 2008-09-26 02:21:46
Message-ID: 19681523.post@talk.nabble.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
OK, I added Connection.setAutoCommit(false)
and now I do not get the exception - that is a major step forward.
But it looks like I am getting an empty ResultSet.

That is probably a database problem.
I will look into that.

Thanks for the assist.

I will repost on this thread if I still have problems.

Thanks again.



burferd wrote:
> 
> Sorry about that, I missed your comment:
> 
> To cursors (without hold) disappear at transaction end.  You need to 
> ensure you have done Connection.setAutoCommit(false) or else the cursor 
> will disappear before you can fetch from it. 
> 
> So, you saying that when I create my original database connection,
> I need to set Connection.setAutoCommit(false)
> 
> I have not seen that in any of the examples/tutorials I have looked at.
> I would expect that to have an effect on updating the database, not
> fetching from the database.
> How will that affect other stored procedure fetches?
> 
> 
> 
> Kris Jurka wrote:
>> 
>> 
>> 
>> On Thu, 25 Sep 2008, burferd wrote:
>> 
>>> Thanks for the fast feedback, but changing the type to OTHER does not 
>>> resolve the problem, I still get the same error.
>> 
>> That was just mentioned in passing for future compatibility, not the real 
>> problem.  As I stated before the real issue is your autocommit setting.
>> 
>> Kris Jurka
>> 
>> 
>> -- 
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Newby-Question---accessing-refcursor.-tp19680083p19681523.html
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.


In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2008-09-26 05:15:20
Subject: Re: Newby Question - accessing refcursor.
Previous:From: Chen, Dongdong (GE Healthcare, consultant)Date: 2008-09-26 02:14:01
Subject: need help of getting PK after insertRow in JDBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group