Subject | Re: [firebird-support] Re: problem with "set transaction read committed no wait no record_version" |
---|---|
Author | Kjell Rilbe |
Post date | 2009-10-12T09:57:30Z |
crizoo4712 wrote:
exactly what you want, but I think this is it:
You want the second transaction to read the last committed version of
each record. If another transaction has uncommitted changes you don't
care - just want to read the last commited one. If another transaction
does commit a new version of a record, you want to see that new version
inside your transaction.
Can you confirm that this is what you want?
This is what read_committed is for - it lets your transaction see
updates made by other transactions, but not until they have committed.
As far as I understand, rec_version allows your read_committed
transaction to read the latest committed version of a record even if
another transaction has updated it but not committed, i.e. even if the
record is currently "dirty", while no_rec_version throws an error in
this case (unless you have wait on your transaction, in which case it
will instead wait for the other transaction to commit).
The purpose seems to be that with no_rec_version your transaction is
guaranteed that when the record is read, no other transaction has
started editing it, i.e. that it's not "dirty". But there's still no
guarantee that no other transaction WILL start editing it and even
commit, before your transaction starts updating the same record and/or
commit it. So, while no_rec_version would reduce the risk of having
outdated data in your application, it does so only on read time. What
happens after that noone knows.
I hope this clears up any remaining misunderstandings and that I didn't
get everything or anything wrong. :-)
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
> > Think he want that read only the data that IS committed and "theChristoph, I find it hard to clearly and unambiguously understand
> record with id 10104 isn't already committed".
>
> That's it! I just want to read the records that are committed. I don't
> even want to read a VERSION of uncommitted records.
exactly what you want, but I think this is it:
You want the second transaction to read the last committed version of
each record. If another transaction has uncommitted changes you don't
care - just want to read the last commited one. If another transaction
does commit a new version of a record, you want to see that new version
inside your transaction.
Can you confirm that this is what you want?
This is what read_committed is for - it lets your transaction see
updates made by other transactions, but not until they have committed.
As far as I understand, rec_version allows your read_committed
transaction to read the latest committed version of a record even if
another transaction has updated it but not committed, i.e. even if the
record is currently "dirty", while no_rec_version throws an error in
this case (unless you have wait on your transaction, in which case it
will instead wait for the other transaction to commit).
The purpose seems to be that with no_rec_version your transaction is
guaranteed that when the record is read, no other transaction has
started editing it, i.e. that it's not "dirty". But there's still no
guarantee that no other transaction WILL start editing it and even
commit, before your transaction starts updating the same record and/or
commit it. So, while no_rec_version would reduce the risk of having
outdated data in your application, it does so only on read time. What
happens after that noone knows.
I hope this clears up any remaining misunderstandings and that I didn't
get everything or anything wrong. :-)
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64