commit transaction failed

From: nasim(dot)sindri(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: commit transaction failed
Date: 2007-06-20 06:29:19
Message-ID: 1182320959.367904.3110@e9g2000prf.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I m having a problem while calling the procedure in prostgresql 8.2
from adoconnection, It gets executed for some time and after 5-10 call
it gives error startTransaction failed or CommitTransaction Failed.

CREATE OR REPLACE FUNCTION sp_getnewfiles(IN strserverid character
varying, IN nmaxcount integer, OUT stroutrecno character varying) AS
$BODY$
DECLARE

cur RECORD;
i integer;
BEGIN
i:=0;

LOCK TABLE inputtable IN ROW EXCLUSIVE MODE NOWAIT;
FOR cur IN select recno from InputTable where FileState=0 order by
recno limit nMaxCount for update
LOOP
if i=0 then
strOutRecNo:='recno=';
else
strOutRecNo:=strOutRecNo || ' or recno=';
end if;

strOutRecNo:=strOutRecNo||cur.recno;
update inputtable set filestate=1,serverid=strServerID where
recno=cur.recno;
i:=i+1;
END LOOP;

EXCEPTION
WHEN no_data_found THEN
--DO NOTHING
WHEN OTHERS THEN
--rollback;
RAISE EXCEPTION 'some error';

END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE STRICT;

the calling code is

CADOXSet rset(pCnn);
ostringstream ost;
ost<<"select * from
sp_getnewfiles('"<<GetServerID()<<"',"<<nMaxCount<<")";
rset.Open(ost.str());
ASSERT(rset.IsEOF()==false);
strRecNo=rset.GetFieldValue(0);

the error I encountered after some number of calls is either -

Error message: Unspecified error
Engine Used: PgOleDb
Error type : StartTransaction failed

or

Error message: Unspecified error
Engine Used: PgOleDb
Error type : commitTransaction failed

Thanks in advance:
Nasim

Browse pgsql-bugs by date

  From Date Subject
Next Message nasim.sindri 2007-06-20 09:56:50 BeginTransaction failed when calling postgresql procedure with ado
Previous Message Tom Lane 2007-06-19 14:20:13 Re: BUG #3394: Partial search not working