From: | Federico Di Gregorio <fog(at)dndg(dot)it> |
---|---|
To: | Vojtěch Rylko <rylko(at)vojtuv(dot)net> |
Cc: | psycopg(at)postgresql(dot)org |
Subject: | Re: Named cursor problem |
Date: | 2012-01-30 16:13:17 |
Message-ID: | 4F26C19D.1040509@dndg.it |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
On 30/01/12 17:09, Vojtěch Rylko wrote:
>
> I am using named cursor in this manner:
>
> cursor = conn.cursor(str(os.getpid))
> cursor.execute("select * from documents;")
> for row in cursor: print do_something(row) # this function also creates
> cursors from "conn"
>
> One million rows have to be processed, but after 10-20 thousands
> processed rows I got an error:
> Traceback (most recent call last):
> File "/homes/eva/xr/xrylko00/spinn/spinn3r/db/db2xml.py", line 408,
> in <module>
> query = query)
> File "/homes/eva/xr/xrylko00/spinn/spinn3r/db/db2xml.py", line 351,
> in create_xml
> for item in self.get_item(column, identifiers, query):
> File "/homes/eva/xr/xrylko00/spinn/spinn3r/db/db2xml.py", line 172,
> in get_item
> for row in cursor:
> ProgrammingError: named cursor isn't valid anymore
>
> Where may be problem?
Did you commit or rollback the connection?
federico
From | Date | Subject | |
---|---|---|---|
Next Message | Vojtěch Rylko | 2012-01-30 16:16:06 | Re: Named cursor problem |
Previous Message | Vojtěch Rylko | 2012-01-30 16:09:15 | Named cursor problem |