Wednesday, December 15, 2010

Networking

Networking

What follows below is applicable only if you will be running ShopAssist® in a network environment. No configuration changes are necessary if ShopAssist® is running on a single computer.
ShopAssist® is fully network-enabled, and up to two hundred terminals can be run off a single server. Under Windows® 95/98/2000 or Windows® NT setting up a network is as simple as inserting an Ethernet card in each of the terminals, connecting them and configuring the software. If ShopAssist® is being used in a network environment, all the live data files will reside on a single designated computer (the server). ShopAssist® (and in particular, the Borland® Database Engine (BDE)) must nevertheless be installed and resident on the server and on all the terminals.
Configuring Network Terminals ShopAssist® accesses the database through a single alias - SA. This alias initially points to the c:\sa\ directory on the local hard drive. For terminals in a network environment, this alias must be made to point to the c:\sa\ directory on the server. This can be done in one of two ways:
(1) Using BDE Administrator To set up a network terminal, you will need to make two, and possibly three, changes. The preferred method of doing so is through the Borland® Database Administrator.
On each terminal do the following: (a) Load the program c:\Program Files\Borland\Common Files\bde\Bdeadmin.exe (b) Click the Databases tab. (c) Click and open the Databases item on the tree list. (d) Single-click the SA item of the tree list. Do not double-click on the item or click on the + sign, as this will open the connection and disable further editing. If this occurs, click the Folder icon in the top left-hand corner of the form to close the connection.
(e) In the right-hand pane, enter the path to the sa directory on the server in the PATH grid cell. The path may be specified using UNC (Universal Naming Convention) (preferred) or using a mapped drive. e.g. (using UNC) if the server’s Computername is Server1 and the root directory of the C drive on the server has been shared as croot then specify the path as \\Server1\croot\sa\ e.g. (using drive mapping) if the sa directory on the server has been mapped to the F drive, then specify the path as F:\sa\
(f) Click the Configuration tab. (g) Double-click the Drivers item on the tree list. (h) Double-click the Native item on the tree list. (i) Click the PARADOX item on the tree list. (j) In the right pane, enter the path to the root directory of the server in the NET DIR grid celle.g. (using UNC) \\Server1\croot\e.g. (using drive mapping) F:\N.B. In a network environment, the BDE NET DIR paths of all nodes on the network must point to a common location (directory) on the server. See also.
(k) Double-click the System item on the tree list. (l) Click the INIT item on the tree list. (m) In the right pane, make sure that the Local Share option is set to TRUE. Note that Local Share must be set to TRUE on all terminals and the server in a network environment. Do not change any settings other than those mentioned above. (n) On the main menu bar, select Object Exit. Assuming everything has been done correctly as above, agree to save all changes made as the default.
Universal Naming Convention UNC is the preferred method for pointing network terminals to the server, the reason being that an innocent user may easily change or delete a mapped drive. The general format of a UNC path is a double backslash, followed by the server’s Computername, followed by a single backslash, followed by the Share Name of the root directory of the server’s C drive, followed by a single backslash, followed (optionally) by the directory you are pointing to followed by single backslash (\\SERVER1\SAFOLDER\
On each terminal: 1. Load Bdeadmin.exe and i Specify the SA alias path as \\SERVER1\SAFOLDER\ ii Specify the NET DIR path as \\SERVER1\SAFOLDER\
Example 2. In this example, the NET DIR path points to a directory other than the c:\sa\ directory on the server. Assuming the server’s Computername is SERVER1, proceed as follows On the server: 1. Create a specific directory to house the Paradox NET file (e.g. c:\sa_contol\)
2. Share the directory as SACONTROL, with full read-write access (do not share with the same name as the directory name) 3. Share the server’s c:\sa\ directory as SAFOLDER, with full read-write access 4. Load Bdeadmin.exe and i Specify the SA alias path as c:\sa\ ii Specify the NET DIR path as \\SERVER1\SACONTROL\ On each terminal: 1. Load Bdeadmin.exe and i Specify the SA alias path as \\SERVER1\SAFOLDER\
ii Specify the NET DIR path as \\SERVER1\SACONTROL\
Note (as demonstrated in the above two examples) that the NET DIR path must be specified in UNC notation, both on the server and all terminals.
N.B. The Borland® Database Engine will be properly configured for the server (and only for the server) by the installation program. Only on network machines (i.e. terminals), does the Borland® Database Engine need to be re-configured to point to the server.
Running ShopAssist® under Windows® Vista Vista’s default security settings do not allow an entire drive to be shared (not easily, anyway) nor does it allow applications to write to the root folder of the C: drive. One or more of the following will allow you to run ShopAssist® under Windows® Vista. 1. Deactivate User Access Control (UAC). To do this, go to Vista Control Panel, go to Search and type in ‘User Access Control’ (or ‘UAC’). An option will appear allowing you to deactivate User Access Control. You will need to be logged in with Administrator rights to do this.
2. Run ShopAssist® as Administrator. To do this, find ShopAssist’s main executable file (c:\sa\sa.exe) in Windows® Explorer (it must be the executable file itself, not a link to the file), right-click on the file, click Properties and enable Run As Administrator.. 3. Run ShopAssist® in Compatibility mode. To do this, find ShopAssist’s main executable file (c:\sa\sa.exe) in Windows® Explorer (it must be the executable file itself, not a link to the file), right-click on the file, click Properties and enable Run This Program In Compatibility Mode.
4. Get ShopAssist® to create a small XML manifest file (c:\sa\sa.exe.manifest) which, if present in the c:\sa\ directory, will request elevated privileges for ShopAssist® at startup. Go to Managerial Preferences Advanced 1, enable the Run With Elevated Privileges option and click Apply to create the file. 4. In Bdeadmin.exe, change the NET DIR path to point to c:\sa\ (rather than c:\) on the server and correspondingly on terminals
e.g. \\SERVER1\SAFOLDER\(Assumes that the server’s computername is SERVER1 and that the c:\sa\ folder on the server has been shared as SAFOLDER)
See also
Lock Files The database engine creates a file called Pdoxusrs.net in the root directory (or the path pointed to by NET DIR) of the server, and files called Pdoxusrs.lck and Paradox.lck in the c\sa\ directory. These files, which control multiple simultaneous access to the database tables in a network environment, are normally deleted by the database engine when the last instance of ShopAssist® is closed. Should you encounter persistent errors of the kind ‘table is locked’, ‘table is busy’ or ‘file is controlled by another NET file’ when starting ShopAssist®, .NET or .LCK files left over from a previous session may perhaps still be present on the hard drive (e.g. due to a power failure or because Windows® or ShopAssist® terminated abnormally) and may be the source of the problem. A utility called c:\sa\clrlocks.exe has been provided to delete these files for you. This utility should be run (either from Windows® Explorer or from the DOS prompt) on the server and on each terminal, but only when no machines are currently running ShopAssist®.
Running ShopAssist® Locally A program called Runlocal.exe has been provided for emergency use in a network environment, to allow ShopAssist® to be run locally (i.e. independently of the server) for short periods of time Run Runlocal.exe to start a local session. This program will launch ShopAssist® and then remain in the background until ShopAssist® terminates. Whilst running in local mode, all data will read from and written to the local hard drive. Inventory database values, for example, will be as up to date as the last time you refreshed the files from the server.
If this module is being used on a once off emergency basis, you should do a dummy cash-up on startup to clear any previous totals. It is up to you to update cash and account sales, stock levels, sales histories, the cash book, etc. when the connection to the server is restored. At the close of a local session we suggest you do a cashup (with relevant reports) and then print a detailed transaction report from the View Previous Transaction Details module to facilitate the updating of data on the server when it is once again on-line.
In order to prevent its misuse, a local encrypted, read-only log is kept of all occasions on which Runlocal has been run. You should check this log periodically, by running Runlocal on the till in question, and check that ShopAssist® hasn’t been run locally without your knowing it. A Logoff time will only be stored if ShopAssist® was actually launched by Runlocal.
Changing A Terminal Back To A Standalone Machine Or Server
If you want to change a terminal back to a standalone machine (or server), proceed as follows: Load the program c:\Program Files\Borland\Common Files\bde\Bdeadmin.exe.and set the SA alias to point to the local machine’s sa directory (e.g. c:\sa\) and set the NET DIR path to point to the local machine’s root directory. (e.g. c:\).
Keeping Terminal Database Files Up To Date It is up to you to ensure that database files on the local machine are kept reasonably up to date, should you ever need to run a terminal in local mode.
Do so by either (i) selecting the Refresh From Server option on the Managerial menu (ii) copying the database files off the server’s c:\sa\ directory and pasting them into the local c:\sa\ directory with Windows® Explorer(iii) copying them onto floppy disk and transferring them to the local c:\sa\ directory.
Concurrency Issues One of the issues facing the developer of a networked application - with multiple terminals reading from and writing to the server simultaneously - is the need to maintain data integrity.
To give an example - two terminals simultaneously read the quantity in stock of an item as 2, both sell one of the item, decrement the quantity in stock by one and write the value 1 back to the server in close succession, the last in of the two writing the wrong value back. In order to prevent this situation from arising, when a transaction is in the process of being finalized (i.e. is being stored), it attempts to obtain a read-write lock on the tables it is writing to, thereby preventing other terminals from reading from or writing to the server at the same time. This may manifest itself as a momentary delay when a transaction is being concluded i.e. while process B is waiting for process A to finish its update.
To give another example - someone loads the stock take module which reads in all the current stock levels. He then decides to have a cup of tea and, after tea, begins updating the stock levels. In the meantime, several of these items have been sold on the terminals. When he eventually saves his updated data to the server, they will not take into account the fact that several of the items have in the meantime been sold. In general, the Stock Control module should not be used while the tills are active. If a till should try to conclude a transaction while it is loaded, it will be held back with an error message stating that ‘table xxx is busy’.
Other modules which use the Inventory table (e.g. the Inventory database module) can be used concurrently with the tills, but with one proviso - while you are actually editing a particular record (i.e. after you have pressed the Return or F2 key on a particular field), the table will be locked to other processes attempting to read from or write to the table.
Running ShopAssist® From Remote Sites If your server is running under Windows NT® Server 4.00 or greater, and you have the Remote Access Service installed and running (or have the Windows® 95 Dial-up Networking upgrade 1.3 installed and running), and have access to a high-speed ISDN line, machines at physically remote sites (a few doors or, perhaps, several hundred kilometres away) can log in using Windows® Dial-Up Networking. After logging in successfully the client becomes simply another node on the network.
While remote connection via normal telephone line is possible, current transfer speeds are too slow to make such a connection viable. In such case we recommend you use PcAnywhere® or similar remote control program. In order to simplify matters, the following protocol is recommended for all branch (dial-in) servers: i) The Computername of the server at each branch must be Server, followed (with no intervening spaces) by the branch number. e.g. the Computername of the server at branch 2 must be Server2, and the Computername of the server at branch 5 must be Server5. (See above for instructions on determining or changing the Computername.)
ii) The root directory of each server must be shared as croot (with full access rights)
E.g. a remote ShopAssist® client using dial-up networking to log in to the server at branch number 4 will expect to find the remote database on the path \\server4\croot\sa\
Establishing A Dial-Up Connection Once the remote server(s) have been set up as above, proceed as follows to establish a dial-up connection to the remote server:(i) Click Start>Programs>Accessories>Dial-up Networking. (If the Dial-up Networking option is not visible, you need to install it by clicking Start>Control Panel>Add/Remove Programs>Windows Setup and then adding the Dial-up Networking option.)
(ii) Click on the icon of the Dial-up server you are connecting to. (If there isn’t one you need to create one by clicking on the Make New Connection option.). Click on the Connect button to establish a connection with the remote server you are connecting to. (Depending on the Network settings on the other end, you may be asked for a password to log in to the network.)(iii) Once you have established a dial-up connection to the remote server, proceed in one of the following ways:
(1) If the local ShopAssist® client always logs in to a fixed remote server (and its SA alias and Netfile directory values have, using Bdeadmine.exe, been configured to permanently point to the remote server), simply load ShopAssist® and it should connect automatically to the remote database (2) If ShopAssist® occasionally logs in to a remote server, or logs in regularly to several remote servers (e.g. from head office), you can proceed in one of two ways:
(a) Run the program called Rmtlogon.exe, present in the c:\sa\ directory. Specify the branch number of the branch you will be logging on to and press Return or click the Proceed button. (b) Load ShopAssist and pass two extra parameters to the program: the word remote, followed by the branch number (or the server Computername†) of the branch being logged in to. Thus, to establish a dial-up connection to the server at branch number 4, load ShopAssist® as:
sa.exe remote 4 The first parameter is mandatory. If the second parameter (the branch number of the branch being connected to or the server’s Computername) is omitted (or is invalid), you will be given the opportunity for providing (or correcting) it when ShopAssist® loads. †(As specifying a fixed Computername for each branch’s server may not always be practicable, you may pass the remote server’s Computername, rather than the branch number, as the second parameter. e.g. to establish a dial-up connection to the server at branch 5 whose Computername is mainserver, load ShopAssist® as
sa.exe remote mainserver The root directory on the C drive and the sa directory must nevertheless still be shared as croot and safolder respectively.) If ShopAssist® is unable to connect to the remote database (e.g. if a dial-up connection has not been established or the remote server Computername provided is invalid) the application will terminate.
General NotesChanging The Computername The server’s Computername (the name by which the computer is known and accessed on the network) may be obtained by right-clicking the Network Neighbourhood icon on the Windows® Desktop and then clicking the Identification tab.
Sharing Drives And Folders (i) Load Windows® Explorer. (ii) Right-click on the C drive icon. A menu item named Sharing should be visible. If this item is not visible you will need to enable sharing on the computer, as detailed in step (iii). If the Sharing menu item is visible proceed to step (iv). (iii) Right-click the Network Neighbourhood icon on the Windows® Desktop. Click the Properties menu option. Click the File And Printer Sharing option (if this option is not visible click the Add button to add it). Enable User-level File And Printer sharing on the computer. (You may be asked for your original Windows® CD-ROM after changing the sharing status of the computer. If the Windows® CD-ROM (or original Windows® disks) are not readily available, you may select the Skip File option for the files Windows® is looking for.) Comply with any suggestion to re-start the computer.
Once File and Printer sharing have been enabled, proceed as in step (iv).(iv) Click on the Sharing menu item and share the C drive as croot. Right-click on the SA directory icon, click the Sharing menu item and share the SA directory as safolder. The icons will change slightly to reflect the fact that they are shared. Both the C drive and the SA directory must be shared with full read-write access.
Setting The Terminal Number In a network environment, each terminal must be assigned a unique terminal number.
Passing Command-line Parameters To ShopAssist® Several ShopAssist® functions may be hidden locally (i.e. on the machine on which ShopAssist® is loaded) by including a particular character in the first parameter:
A to hide the Accounts moduleC to hide the credit note function
D to hide the Administrator Mode facilityF to hide the Remove From Till facilityG to hide the Gift Voucher moduleH to hide the Hire moduleI to load ShopAssist® in Adminstrator modeL to hide the Lay By moduleM to load ShopAssist® with a minimal set of drivers {The Chart and Windows® slip printer drivers will not be loaded. The same action may be invoked at start-up by pressing Ctrl M when the splash screen is showing.)
O to hide the Compare Lists utilityP to hide the Appro moduleR to hide the Repair moduleS to hide the Spreadsheet moduleT to hide the Trip Sheet moduleV to hide the Advance To Till facilityW to hide the Till Watch moduleX to hide the Exchange facilityY to load ShopAssist® in Till-only mode
Thus if you wish to hide the Managerial menu on a particular terminal, then include the letter M in the first parameter.e.g. SA.EXE M to hide the Managerial menu. To hide the Accounts menu on terminals, include the letter A in the first parameter. e.g. SA.EXE MA to hide the Managerial and Accounts menus.
Parameter I takes prececedence over parameter Y. If both prameters are spcified.ShopAssist® will start up in Administrator mode.
If you wish to hide any of the above modules or functions globally (i.e. on the server and all terminals logging on to the server) then select the appropriate option on the Customize page of the Preferences form.
Pass the parameter BACKGROUND=xxx to load ShopAssist® with a particular background colour or bitmap. xxx must correspond exactly to one of the backgrounds offered on the Miscellaneous page of the Preferences form.
e.g. C:\SA\SA.EXE BACKGROUND=Navy e.g. C:\SA\SA.EXE BACKGROUND=Clouds.bmp To load ShopAssist® with a particular background colour (or bitmap) and a particular till number (e.g. to distinguish multiple instances of ShopAssist® on the same machine), pass the parameters BACKGROUND=xxx TILLNUMBER=ne.g. to load ShopAssist® with a Blue background as till number 2, load ShopAssist® asC:\SA\SA.EXE BACKGROUND=Navy TILLNUMBER=2
Network Troubleshooting In addition to the matters discussed above, here are a few more points to note in a network environment:
(a) The fastest possible network system should be used. In a large network environment (four or more terminals), a switch, rather than a hub, should be used. Increasing the maximum number of file handles to 100, and the maximum data cache size to 16384 Kb on on the Network Network 1 page of Preferences, may improve BDE performance.
Enabling the Keep Open Database Connections To A Minimum option on the Network Network 1 page of Preferences in a network environment of four or more terminals may improve performance.
(b) The maximum lengths for the various types of network cable should be strictly adhered to. Exceeding the specified maxima may lead to signal attenuation/distortion and possible data loss.
(c) Each terminal must at all times be mapped, using either UNC (Universal Naming Convention) or via a single drive letter, to the server. The disadvantage of the latter is that if a terminal attempts to log on while the server is off-line, Windows® displays a message box informing the user that the connection could not be made and asks whether he/she would like to try re-connect next time. If NO is the reply, the mapping to the server is lost and must be set up again the next time the terminal logs on.
(d) If you install certain ODBC drivers (e.g. a Paradox driver for Microsoft Access®), or other packages which use the Borland® Database Engine, the Database Engine configuration file may be corrupted and you may need to re-install ShopAssist®. First of all, use the Bdeadmin.exe utility to try and re-establish an SA alias pointing to the c:\sa\ directory on the local machine or server. If this fails, proceed as follows:
(i) if you don’t need to retain your data, uninstall ShopAssist® with the Add/Remove Programs component of Windows® Control Panel. If you do need to retain your data then copy, back up or zip all the data files in the c:\sa\ directory (i.e. all files that don’t have the extension EXE, RPT or DLL) to another temporary directory (click Managerial Data Back Up To Local Drive in ShopAssist® to have this done automatically for you)
(ii) uninstall ShopAssist® with the Add/Remove Programs component of the Control Panel. (iii) reinstall ShopAssist® from the original install disks or zip file. (iv) if you saved your previous data files in step (i) then copy, restore or unzip all the files you saved back to the c:\sa\ directory.
ShopAssist® Point Of Sale System. © ISC 1997-2008.

No comments:

Post a Comment