-------- Original-Nachricht --------
Datum: Wed, 05 Jul 2006 19:30:04 +0100
Von: Nikki Locke <[EMAIL PROTECTED]>
An: sqlite-users@sqlite.org
Betreff: Re: [sqlite] Multiple Users

> We seem to have a misunderstanding over the definition of "optomistic 
> locking".

Yes, maybe...  ;-)

> To me, "optimistic" locking means the application doesn't do any locking 
> when a record is read. All it does it to retain the timestamp of the
> record when it was read.

I'm oriented to the definitons from OLEDB
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdcstlocktypeenum.asp

Citation:
adLockOptimistic        
Indicates optimistic locking, record by record. 
The provider uses optimistic locking, locking records only when you 
call the Update method.

adLockPessimistic       
Indicates pessimistic locking, record by record. The provider 
does what is necessary to ensure successful editing of the 
records, usually by locking records at the data source 
immediately after editing.

> When the application wants to write edited records back to the database,
> it does something like...

Likewise....

First, if I want to fetch a Record, I allways store a timestamp in 
combination with the Records-ID and further needed parameters. Then 
I search for a older Timestamp with exactly equal parameters. If I 
dont found anyone, I'm the first User with authorisation to change 
this record. After this any other User can only store a Timestamp it 
be younger as mine. All Edit-Controls on View are Write-Protected in 
this case. The Statusline shows a Message, which User is owner of 
this Record.

My Problems are now solved. SQLite performs a physical locking at
the DB-File during writing to Disk. Any other Frontend-Instances
do wait, until the Writing is ready. The Writer-Frontend release
the DB after the succesfully end of the Write-Process. I dont have 
to do anything... SQlite is a clever DB  ;-)

Greetings, Anne


-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*!
"Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl

Reply via email to