Subject | Transactions |
---|---|
Author | Joshua Higgs |
Post date | 2003-07-18T02:41:09Z |
Good morning all
Supposing I had two transactions and I did something like this:
txnRead.starttransaction;
qryRead.open; //This sets txnRead.intransaction to false!
txnUpdate.starttransaction;
qryUpdate.execsql;
txnUpdate.commit;
qryRead.close;
if txnRead.intransaction then
txnRead.commit; //This never executes!
txnRead.starttransaction;
qryRead.open;
//both queries are have autocommit = false, and isolation of tiConcurrency.
//the read query is a TIBOQuery (with datasource attached)
//the update query is a TIB_Query.
The problem I am having is that as soon as I open the qryRead the first
time, the
txnRead suddenly is no longer in a transaction.
This means that after my update and reopening the query, the change is not
reflected
in the second opening of qryRead.
However, if I change txnRead isolation to tiCommited, it works (change is
reflected) from the second opening onward, but the first time I open qryRead
it still sets txnRead.intransaction to false. I thought tiConcurrency
isolation was a snapshot?
I can't understand what I have wrong that makes it do this.
Thanks
Josh
[Non-text portions of this message have been removed]
Supposing I had two transactions and I did something like this:
txnRead.starttransaction;
qryRead.open; //This sets txnRead.intransaction to false!
txnUpdate.starttransaction;
qryUpdate.execsql;
txnUpdate.commit;
qryRead.close;
if txnRead.intransaction then
txnRead.commit; //This never executes!
txnRead.starttransaction;
qryRead.open;
//both queries are have autocommit = false, and isolation of tiConcurrency.
//the read query is a TIBOQuery (with datasource attached)
//the update query is a TIB_Query.
The problem I am having is that as soon as I open the qryRead the first
time, the
txnRead suddenly is no longer in a transaction.
This means that after my update and reopening the query, the change is not
reflected
in the second opening of qryRead.
However, if I change txnRead isolation to tiCommited, it works (change is
reflected) from the second opening onward, but the first time I open qryRead
it still sets txnRead.intransaction to false. I thought tiConcurrency
isolation was a snapshot?
I can't understand what I have wrong that makes it do this.
Thanks
Josh
[Non-text portions of this message have been removed]