Many to many relation. How?

Robert Brenstein rjb at rz.uni-potsdam.de
Mon Dec 6 14:42:47 CST 2004


>  > Actually, the table should really be used for storing it only through
>>  quits. In other words, when your program launches, it should read the
>>  value from the table into some global (persistent) variable and
>>  handle it through a function. Each time the function is called, it
>>  increases the id counter and saves the new value into the table
>>  before returning the value to caller. Such a single dispatch will
>>  eliminate any race conditions and the value in the table will be
>>  always matching the saved state of the db (regardless whether the
>>  program was properly shut down or crashed).
>>
>>  Robert
>Hm, that can't work in a multi user invironment (Vserver). If I store the id
>local, it will be decreased by other users and I have not the latest in my
>variable. And all users should  have access to the latest id.
>And the question is still there: If user 1 writes the new id, user 2 can't.
>So do I have to perform a loop, that looks for a r/w cursor or can I use
>baseobject and it will be processed one after another automatically or is
>there another automatic possibility?
>
>Cheers,
>Ralf

Ah, I did not realize that you are talking client-server. A variation 
of this can still work but details would depend on your specific 
situation. If your serialization is only to get unique identication, 
then you could use the recId values that Valentina assigns 
automatically. If your records are not deleted, these would actually 
be serial numbers.

Robert


More information about the Valentina mailing list