cursor/api

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Feb 10 12:38:40 CST 2005


On 2/10/05 12:00 PM, "Ralf Sander" <ralf at end-if.de> wrote:

>>> I thougth, I could create my own lock:
>>> try to write to "lock" field of record, if "lock" field is empty and no
>>> write error, write username to lock field of record...
>> 
>> But what sense?! You should use built-in locks.
>> And Later when we will get transactions develop will not need manually
>> control locks. 
> What are transactions and when is "later"?

Transactions? Long story, better read books.

Transaction this is feature that make sure
- all your changes are committed or refused.

Later -- in 3.0

 
>>>> 2) actually Cursor also is based on RecID, just you not see this.
>>>> and cursor can/should lock selected records.
>>> But a deleted record does no longer contain any data in the cursor,
>>> even if the rec id is reused. Is there any build in check?
>> 
>> The correct way is:
>> cursor -- lock its records.
>> so issue with deleted record must never happens
> 
> 
> The main data for viewing is a thunbnail and the name of a record.

> So it makes not really sence for me to prevent a record from viewing,
> because anyone is modifying any other field.

You can move thunbnail into linked table

You can do next:

* you have cursor for browsing. They set NO LOCKS.
    so you always can read.
    but this cursor should not write.

* for write you need obtain other cursor, set lock WRITE on a record,
    then only delete or update it.

Else you get next problem:
    user1 have read record 555
    user2 also have read it

They both start change it.
    user1 update
    user2 also update

Ops, changes from user1 are lost.

All this potential problems are described in the books.


> The other way round it makes no sence to prevent a record from editing,
> because anyone is viewing it.

> Will there be problems like crashs if someone trys to get a cursor for a
> record, that someone other is editing at the same time or will he simply get
> the current state of the record?

Crash of course will not happens.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina-beta mailing list