Isolation levels in Informix vs Oracle
Answered: red (hollow confidence) — Only message present is a follow-up fragment posing an isolation-level question ('am i wrong here?'); no reply is captured, likely a threading break.
Advisory only.
Posted in 2004
Sorry for not being clear; Here goes:
what i ment was for the report:
start trx at 13:59 complete at 14:00.00001
get the account info at 14:00.00000
define what one wants
in reallity the trx should be part of the results. (it did not got
rolled
back and it started before the report was started.)
if it did roll back you did not want the above transaction!!
However it's unkown at the time the report begun.
if you keep track of transactions in a trx table and not change the
account
info (only on specified intervals; some daemon job)
and have a table like:
create table transactions(
whenstarted datetime year to fraction(5),
the_account int,
from_to_account int,
howmuch money(20,3),
updated_accinfo boolean,
when_updated_accinfo datetime year to fraction,
reasontrx char(200)....
etc
);
you can simply insert two rows in this table to acomplish a transfer
from acc1 to acc2 in one transaction and yes to get the info for
both accounts at that time will have to wait until the insert has
committed so one can get the info out of the account table and process
the info for transactions i guess it can be done differently also??!!
The transaction table is also for the customers so they can see what
happened to their account. If something is wrong one can look which
transaction from who etc is responcible.
Also you can run the report with commited read and lock mode to wait
to get
the correct results.
-- The demo I do for my classes to demonstrate this issue is as
follows:
-- Assume two bank accounts and you are transferring money between
them.
-- At some point in time an update must decrement the balance in one
and
-- a separate update but increment the balance in the other. In most
-- databases you must lock both accounts until both update statements
take
-- place or risk a combined balance that is inaccurate. In Oracle that
-- answer will always be consistent without locking.
sorry for my ignorance; i do NOT know Oracle; (typo in my first
responce... sorry.)
how does the following work then:
begin situation $100 for acc1 and acc2
transfer from acc1 $10 to acc2
then simultanious transaction adds $10 to acc1 based on the old value
of $100
trx 1 commits making acc1 eq to $90 then trx 2 commits and set's the
value
to $110. ahum you loose $10 ??!!!
am i wrong here or what do i miss??
See you
Superboer.