[V4RB] Serving a db over the web

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Dec 4 23:00:25 CST 2003


on 12/4/03 9:30 PM, jda at jda at his.com wrote:

> I've been working on sharing databases over the web via a
> ServerSocket in RB. It works very well, but I'm concerned about what
> happens when there are user "collisions", especially with the new
> record locks. This is not Server, but the usual embedded Valentina.
> 
> 1. I have arranged it so that only databases not in use locally can
> be accessed via the internet, which prevents access during database
> writes.
> 
> 2. You cannot write to the database via the internet.
> 
> 3. My cursor record permissions are all set to kReadOnly. As of now,
> records in such a cursor cannot be accessed by anyone else (even
> though they are unmodifiable). This would cause problems if there was
> a collision between users trying to access the records. Will that
> change in 2.0, Ruslan? Why can't we access a kReadOnly record just to
> read it?

Wait a moment.

If one cursor set ReadOnly lock,
Then OTHER cursors can also READ this record, if they also do ReadOnly lock.

So you must not have any problems!
Or I have not understand something, Jon?


And Yes, for 2.0 we must also implement optimistic record locks.
This can reduce the number of conflicts.


> 4. Instead of record locks, should I change every cursor to kNoLocks?
> If so, are there any downsides (remembering that the databases cannot
> be shared under any circumstances)?

You can use NoLocks, if you sure nobody will write.
No downsides.

But I am sure that ReadOnly also must works for you.
Again, keep in mind, that

        ReadOnly = Shared Lock
        ReadWrite = Exclusive lock.


> 5. Finally, if I use kNoLocks, do I need to set kRandomAccess (as
> opposed to kForwardOnly), or now does it default to the old way
> (which was kRandomAccess).

This parameter will be ignored with NoLocks.

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