Re: UDR: DBINFO('sqlca.sqlerrd1') -- transaction based?
Posted in 2001
Alexander
I have seen this error when the database itself does not support transactions.
You need to make the database support transactions (see ontape).
HTH
Sujit
aterrill@inrelation.com on 01/12/2001 02:21:55 PM
Please respond to aterrill@inrelation.com
To: informix-list@iiug.org
cc:
Subject: UDR: DBINFO('sqlca.sqlerrd1') -- transaction based?
Hello,
I am trying to write a UDR that is a sequence number generator: uses a
separate table to hold sequence values. Does the DBINFO function in
Informix need to be transaction based to be used properly? This seems
to make sense to me that you would need to execute this as a
transacation to make this work properly. Otherwise you might get an
incorrect value back in high load conditions? However, is this true
even for UDR functions? Are UDRs inherently transaction based? If I
add BEGIN WORK / COMMIT WORK to the following function I get a
java.sql.SQLException: Transaction not available error. Any
suggestions? Is this a good way to tackle this problem?
CREATE FUNCTION serial_udr ( )
RETURNING INT8; DEFINE id INT8;
INSERT INTO sequence (timestamp) VALUES (CURRENT); LET id = DBINFO('sqlca.sqlerrd1');
RETURN id;
END FUNCTION;
Thanks for the help,
Alexander Terrill
inrelation.com
Sent via Deja.com
http://www.deja.com/