Web Site Login
PSQL10 PSQL9 PSQL8 PSQL2K PSQL7 AMS Users Mailing List Mailing List Survey
^ September: Data Protection! ^

August Results: No Survey


[See All Surveys]

Using Gateways with Pervasive.SQL
Last Updated: 05/22/2003


The Pervasive.SQL 2000i and Pervasive.SQL V8 WorkGroup Engines (WGE) offer performance and features similar to a Client/Server Engine (CSE), but at a price that can't be beat. We strongly recommend the use of Pervasive.SQL V8 WGE for all smaller environments looking to upgrade from Btrieve 6.15 Workstation Engines.


Table of Contents:
What is a gateway?

How do I tell which computer is the gateway right now?

Should I lock down the gateway permanently?

How do I set a permanent gateway?


What is a gateway?

In the old days of Btrieve 6.15, each computer tried to access the database in the same way, making changes to the files as needed. This was called Multi-Engine File Sharing, or MEFS for short. The concept was simple -- use a shared locking file (*.LCK) for each Btrieve file to lock the other database engines out of the file while you process a set of changes. The problem here is that several machines are then "fighting" over the database files, and performance starts to drop as you add users to the system. (Imagine having 4 teenagers and only one phone line.)

The solution is to use a Client/Server Engine (CSE) configuration to maximize performance by having all clients send their database requests to the server, and the server handles all the details, eliminating the fighting. Other benefits from the CSE include database security and improved performance (along with reduced network load). The downside to the CSE is price, though, especially for smaller systems. Enter the WorkGroup Engine! The WGE is just like a CSE, without the extra security and performance bells & whistles, and it is available for a VERY low price. In fact, Pervasive.SQL V8 WGE is only $25/seat! The problem here is that the database is now loaded on multiple machines, and we need to prevent the fighting from coming back.

Enter the referee -- the gateway. When the first computer starts the application, ther database engine accesses the gateway locator file (~PVSW~.LOC) in the directory with the database files. If there is no file (because nobody is in the system yet), then the engine creates a new file, stamps the computers name into it, and locks it open. This computer is now the gateway, or the database server, for the data files in this directory. When a second computer starts up the application, it sees that the gateway locator file is present, and contacts that computer to access the data files on its behalf.

Sounds great, right? But what happens when the gateway computer crashes or the user shuts down? All users get kicked out of the application, since the database engine they were using is now gone. As they restart the application, the first one in will become a new gateway and will be the database server from that point forward.



How do I tell which computer is the gateway right now?

The gateway locator file, ~PVSW~.LOC, contains the information about the current gateway. You can query this file by simply TYPEing it to the screen, or by using the Gateway Locator utility. First, start the utility from the Start/Programs/Pervasive.SQL menu structure.



Then, change the path in the upper box to the location where your data files are located, and the existing gateway will be displayed on the lower half of the dialog box. In this case, the box EMKAY is the current gateway. You can refresh this display at any time by clicking <Refresh>.



Should I lock down the gateway permanently?

A permanent gateway exists when we force a single machine to become the gateway at all times. This configuration can provide great benefits, but it can make a few things more complex, as well. Let's look at the advantages and disadvantages here.


Advantages
  • A permanent gateway allows you to force the computer which contains the physical files (also known as a peer server) to open them. This provides the best performance and best stability for the environment, and is strongly recommended. Even with a WGE configuration, this could mean that you need a license for the server, even if nobody runs the applications from the server.
  • A permanent gateway means that you will always know who the database server is. You can try to minimize the use of that computer and make sure that that system has extra memory and a faster CPU to better support the database users.

Disadvantages
  • If you set a permanent gateway and the gateway computer is unavailable, the environment will not work at all. Make sure that the gateway computer is ALWAYS started up before anyone attempts to use the application.
  • If you change the name of the gateway computer, the environment will break. Use the Gateway Locator utility to set a new permanent gateway.
Goldstar Software ALWAYS recommends that a permanent gateway be assigned for our customers. It is true that some problems may occur, especially if you need to replace the machine acting as the server, but these problems are few & far between and can easily be resolved. On the other hand, having a floating gateway that is inadvertantly shut down during the day can create substantial problems with lost productivity.

How do I set a permanent gateway?

We have created a downloadable video which describes this process. To see the video, click HERE!

Using the Gateway Locator utility, first navigate to the directory that contains your data files. Note that the default directory of C:\PVSW\BIN\ does NOT contain any data files, and if you do not set the correct directory, you won't be doing any good. Click on the <Change> button to bring up the next dialog box.



From here, enter the computer name (or browse to it) for the permanent gateway computer, and click OK. That's all there is!

To remove a permanent gateway, select the option "Do not assign a gateway" from the above dialog box. Note that when you are setting or clearing the permanent gateway, no users can be in the database at this time.

If you still can't get it to work, contact Goldstar Software and let us work with you to help!
  Copyright © 1997-2008, Goldstar Software Inc., All rights reserved. PRODUCTS | SERVICES | TRAINING | SUPPORT | DOWNLOADS | ABOUT US  
  Legal Statements | Privacy Statements | Contact Us