V4WS need to use semaphores when READ from table in case cause simultaneous indexing?

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Nov 27 09:38:42 CST 2004


On 11/27/04 5:28 AM, "Steven" <srt at bigpond.net.au> wrote:

> Ruslan,
> 
>> 1) I am sorry, I have lost in your long-paragraph questions.
>> 
>> Can you formulate PROBLEM if it exists in simple way:
>> - I do next
>> - I expect this
>> - but I get that.
>> 
>> Do you have real problem?
>> Or you ask for the "right way" ?
>> 
> 
> I ask for the "right way". I will try to be clearer in what I am asking by
> giving example code, embedded with short specific questions.
> 
> Example:
> 
> I make a database:
> 
> dbRef_testdb=valMakeNewDatabase("testdb");
> boRef_test=valMakeNewBaseObject( dbRef_testdb, "test" );
> fldRef=valMakeNewField( boRef_test, "t1", "String",14);
> valSetFlagOfField( fldRef, 1, true );
> fldRef=valMakeNewField( boRef_test, "t2", "String",6);
> valSetFlagOfField( fldRef, 1, false );
> 
> Receive as input var1 and var2 from a user (form submission) and add them
> to "test" as t1 and t2 respectively. Multiple users are submitting forms
> simultaneously:
> 
> METHOD 1:
> cursorRef_test=valSQLSelect(dbRef_Tdb, "SELECT t1,t2 FROM test WHERE
> RecID=0");
> valSetBlankRecord( cursorRef_test );
> valSetField( cursorRef_test, 1, var1 ); //this is an indexed field
> valSetField( cursorRef_test, 2, var2 );
> valAddRecord(cursorRef_test); //THIS WILL CAUSE INDEX FOR TEST TO BE
> UPDATED
> 
> METHOD 2:
> acquireSem("test");
> cursorRef_test=valSQLSelect(dbRef_Tdb, "SELECT t1,t2 FROM test WHERE
> RecID=0");
> valSetBlankRecord( cursorRef_test );
> valSetField( cursorRef_test, 1, var1 ); //this is an indexed field
> valSetField( cursorRef_test, 2, var2 );
> valAddRecord(cursorRef_test); //THIS WILL CAUSE INDEX FOR TEST TO BE
> UPDATED
> releaseSem("test");
> 
> QUESTION 1: Can I use METHOD 1 safely with V4WS on Mac OS 9, or do I need
> to use METHOD 2 to avoid problems with simultaneous indexing?

I think you can. 

Again. Valentina have record level locks.
So if cursor of first user lock some records, then second user cannot access
them until first unblock them.
 
> QUESTION 2: Is the index for "test" only altered when a record is added or
> deleted (but not when a field is searched)?

Yes, of course.

But I still do not catch why you do care about indexes?
You think that they can work in other thread?
This is true only for VAPP.
V4WS index in the same thread.


>> 3) for OS X....
>> You want say that it is planned for WebSiphon for OS X ?!
>> This is news for me. I did think that WS will never be ported to OS X
>> where exists Apache + PHP.
> 
> WS is being ported to OS X, according to Purity website (
> http://www.purity.com/ about half way down the page).

> Yes there is PHP, but there is also MySQL. Just as there is a role for
> Valentina even in the face of "free" MySQL, I think it makes sense to have
> WS for OS X. It gives the smart developer a superior solution - WS/V4WS
> instead of PHP/MySQL. Superior means faster, better support, easier to use,
> better thought out, you name it. So please provide V4WS for WS 3!

Well. At first we should get WS :-)

And then note. IF this happens then Valentina for WS 3
Will be changed. IT will be NOT as local plugin as you have now,
But as CLIENT to Valentina Server.

We think that for web hosting better to use Valentina Server,
Which is designed for multi-user access, which have threads inside to serve
to several clients in the same time.

-- 
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 mailing list