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

Steven srt at bigpond.net.au
Sat Nov 27 03:28:09 CST 2004


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?

QUESTION 2: Is the index for "test" only altered when a record is added or
deleted (but not when a field is searched)?


>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!

Steven




More information about the Valentina mailing list