TEXT datatype, transactions, and al. Hello,
I have one table "message" 2 processes post data into.
To address concurrency issues, I have one table "counter" and one table
"get_counter".
Basically to post data, every process does this:
1- my_id = get_counter()
2- INSERT INTO message VALUES(my_id, my_message)
a. my_message is a TEXT variable. I cannot use a stored_procedure to do step
1 and 2 together, because ASE refuses TEXT variables as stored procedure
parameters.
b. Now my company, because of a kind of "holy" belief does not trust
transactions. I cannot use transactions to do step 1 and 2.
c. Last requirement, I want to know which my_id was used after the insertion
took place.
I came up with this solution. Executing the single query:
BEGIN
DECLARE @my_id INT
EXEC @my_id = get_counter()
INSERT INTO message VALUES(@my_id, my_message)
SELECT @my_id
END
and getting the result.
This mainly works. Because of database drivers problems, I am not always (ie
it fails on same machines) able to catch the variable selected by the query.
I know there are multiple recordsets, but some drivers just seem to fail in
this case.
I am running out of ideas, I do not know what to try next...
Any suggestsions?
Thanks in advance,
SerGioGioGio |