Resume: Building multiuser database apps

Resume: Building multiuser database apps

Post by Alexey A. Sedo » Sat, 16 Sep 1995 04:00:00



Hi, all multiuser app's builders!

I sent to all two questions about building VB 3.0 apps for
multiuser (and multitasking) net environments. I have got a few
answers. I want to resume your answers to the FAQ form. I hope,
it's help other programmers, because somebody ask me to send
them results.

============================================================================
I. My letters:
----------------------------------------------------------------------------
(1) Hi VB+Novell+Access Gurus!

I have developed an Application using VB 3.0 Prof & MS Access 2.0
for the single user mode. Now I must rewrite it for the
multi user mode (MS Windows for Wrkgrp 3.11 + Novell Netware).
I'll do it at the first time. Before I'll do it my own manner :-(,
can you tell me, please:

        Does anyone know how it can be done properly...

----------------------------------------------------------------------------
(2) Hi!

How can I prevent writing into the same database's
(MS Access 2.0) table at the same time from different users
of my application (they work with many instances of the same
application in the multi user environment Windows for Workgroup
& Novell Netware)? Is there a discipline of a correct access
(writing & reading) to the same data table from many users
at the same time (from within VB 3.0 App & MS Access 2.0)?
Can You tell me, please, where can I read about it? Any code
examples from FTPs are very appriciated things too!

=============================================================================
II. Your answers:
=============================================================================

-----------------------------------------------------------------------------
(1) What's the place, where you can ask about that?
-----------------------------------------------------------------------------


  ..................................................

  Try asking in the comp.lang.basic.visual.database newsgroup.


  ...........................................

  Check out "Locks" and "Locking Pessimistic/Optimistic" in the VB Help.

-----------------------------------------------------------------------------
(2) Is that possible at once???
-----------------------------------------------------------------------------


  ................................................................

  You can't do what you are saying your doing, you can't open
  a page in an access database if it is already open. It is
  possible to open multiple dynasets in which changes may
  occur, the writing sequence occurs when the first dynaset
  or table is closed, but still you can't write to the same
  record at the same time or any record with in the open page.
  the factory page length is 64k, this can be adjusted from
  ODBC admin in the control panel, most people like to have
  this far smaller than 64k, for regular data, if your working
  with a lot of records with graphics with consistant sizes may
  want it larger.

-----------------------------------------------------------------------------
(3) Is there a discipline for multiuser database apps?
-----------------------------------------------------------------------------


  ..................................................

  It *is* possible, and it's not that difficult. It is however different
  from most other database locking systems you may have used
  before. You *must* understand how Access uses "page locking".

  Page locking implies that you will very often run into a lock. With
  record locking you can treat hitting a lock as a fairly serious event,
  so you don't have to be too friendly about handling it. With page
  locking, you're likely to hit page locks many times you try to save a
  record.

  Simple rules:

    Try to avoid having locks in existence. When you do
    have a lock out, keep it short. Use "optimistic locking"
    rather than "pessimistic locking", as this only applies
    the lock for the shortest time.

    Assume that locks from other users may be in place. Allow
    automatic retries with a short time delay between them, then
    when the time becomes too long, start giving a "Lock in place
    Retry/Cancel ?" dialog.

  Try to get hold of the "Database Developer's Guide Using VB" by
  Jennings, from Sybex.

-----------------------------------------------------------------------------
(4) What's an open database mode? What's a share mode?
-----------------------------------------------------------------------------


  ....................................................................

  ...I understood that setting one of the data control properties
  (DATA1.EXCLUSIVE=false) is multi user and setting it to true is
  single user. Also I think all machines must be running SHARE from
  DOS or an equiv.


  ................................................

  Just don't open the db read only.

-----------------------------------------------------------------------------
(5) May I use Access' authorizations? How can I debug my app?
-----------------------------------------------------------------------------


  .....................................

  If you use Access database, then you'd define authorizations
  for your users, then launch application from 2 workstations and watch...

-----------------------------------------------------------------------------
(6) How can I prevent and trap errors?
-----------------------------------------------------------------------------


  ...............................................

  Try using data1.refresh where ever possible. This will stop error
  occuring when other uses delete or modify records will other user
  are viewing the same record. Also put in error traps such as
  On Error Resume Next as a final tip make your applications database
  exlusice to the application. This will save people doing *
  things will the app is in use. Do this by data1.Exclusive.

-----------------------------------------------------------------------------
(7) How many users can I serve without any problems?
-----------------------------------------------------------------------------


  ................................................

  ...be careful w/the numbers concurrent users. If they are more
  than 5 you may run into problems with performance and locking.

-----------------------------------------------------------------------------
(8) May I get problems with data integrity? What can I do with it?


  .................................................................

  The biggest difference is that you'll have to put the database up
  on the network. This means you'll have to check how you open your
  databases (exclusive/shared,read/write or read-only). From my experience,
  MS Access does have some innate weaknesses on the network. Data integrity
  (we experienced a lot of data corruption problems) and some performance
  issues are two reasons we went away from Access as the database for our
  application. We ended up using Microsoft SQL Server 4.2.1 in the end.
  We do still use the Access JET engine through attachments (we attached
  the SQL Server tables in an *.MDB file).

=============================================================================

  That's all your answers I've received (15-Sep-95).
  Hope, it's help somebody.

  Sincerely Yours,
    Alexey A. SEDOV, Moscow Univercity, Russia

 
 
 

1. How to build an app (with bde) that runs with other bde-apps

Hi,

I have build an application in D4 and BDE 5.0. I use a partial BDE
installation on my clients. To avoid problems with other applications that
use the BDE I fill my own DBIEnv structre and use the functions dbiInit /
dbiExit. This seems to work fine. After the installation of another
application that uses the BDE my app will still run. The only problem is that
I can't run both apps at the same time. I recieve an error when I start the
second application.

How can I solve this problem????

T.I.A.
Michel

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Identity values

3. Using One user in my multiuser APP

4. Problems with Update Statement

5. Multiuser apps in VB 6.0 Pro

6. [Mac]Applescript

7. Installing Multiuser Access app, HOW?

8. MSFlexGrid

9. MultiUser Delphi App Using Paradox - Help !

10. Prob: Multiuser App w/ dBASE

11. MultiUser App

12. Multiuser app in a Win95 network

13. Multiuser App using Paradox Tables