4D v14

Working Concurrently with 4D Server

Home

 
4D v14
Working Concurrently with 4D Server

Working Concurrently with 4D Server  


 

 

If you run this tutorial on Windows, you could use this server database “as is” on Macintosh. If you run this tutorial on Macintosh, you could use this server database “as is” on Windows.

For this tutorial, we will connect to the server database with a remote 4D on Windows and a remote 4D on Mac OS. As soon as you are connected, you can see the second user entry in the 4D Server Administration window (the first column indicates the operating system of the remote machine):

On each client machine, everything done on the other platform is instaneously and transparently reusable. Here is the Design environment on a remote client machine on Mac OS:

Your six records and your two methods are here!

1. On the first remote machine, in "Test Application" mode, choose Queries... from the Tutorial menu, and look for the records where “Department is equal to Engineering”.

2. Do the same thing on the second remote machine.

On both machines, you obtain a list composed of three records.

3. On the first machine, double-click on the record “Parker, Arthur”.

Your screen should look like this:

4. Do the same thing on the second machine.

4D Server has a built-in record locking mechanism and warns you that the record is already in use:

Nevertheless, you have access to the record in read-only (you can display it, but cannot modify it).

5. On the first machine, change the first name to “Michael” and validate your changes.

The list has been updated with the new first name.

6. On the second machine, cancel the display of the record in the input form.

The list has been updated with the new first name too!

4D Server is both a data and an application server. Let’s see what this means.

1. On the second machine, press the Esc. key, then choose the Return to Design mode command in the Mode menu.

2. Do the same thing on the first machine.

3. On the first machine, choose Explorer > Forms from the Design menu.

The Explorer window appears.

4. Choose the table form and expand the Employees table:

5. Double-click the Input form.

A Form Editor window is opened for the Input form:

6. Do the same thing on the second machine.

Since the form is already in Edit mode on the other machine, the 4D Server built-in object locking mechanism informs you:

Nevertheless, you can open the form on the second machine in display mode. You can select objects and copy them to other forms, but you cannot modify the form itself.

Note the padlock icon in the upper right corner of the form. This icon reminds you that you cannot change the form.

7. On the first machine, select the legend “Last name” on the left of the [Employees]Last Name field.

8. Using the Object>Color hierarchical menu, set the color of this object to red.

9. Select Save Form: [Employees]Input from the File menu.

10. On the second machine, close and reopen the form in order to reload it.

The change made on the other machine is now available on this one.

4D Server allows you to develop concurrently a database with other users!

In addition to informing 4D remote users during simultaneous access to the same records or objects, 4D Server includes a built-in shutdown warning message over the network.

1. Keeping the two clients connected the server database, on the server machine, choose Quit from the File menu (Windows) or the 4D Server menu (Mac OS).

The Shutting Down dialog box appears:

2. Click OK.

Almost instantaneously, the two client machines are informed that the server is shutting down. For example, if a client were adding a record, the user would have enough time to finish and validate the data entry.

This warning dialog box is repeated regularly on each client machine.

Note: Alternatively, you can shut down the server using the “Wait for all users to disconnect” option (while possibly sending them a message asking them to disconnect as soon as possible) or to force immediate disconnection of the clients using the "Disconnect all clients and quit" option.

3. While the server is shutting down, quit 4D on the two remote machines.

With this tutorial (which may take more than 10 minutes, depending on various factors, such as time you took for a drink), you have discovered how easy it is to use 4D Server:

  • You created a database from scratch.
  • You defined a table and let 4D Server create the forms for you.
  • You added and manipulated some records.
  • You customized your application with your own menu bar.
  • You used the server database concurrently on both Windows and Macintosh.
  • You shut down the server and restarted it.

To conclude, you created two custom applications (Windows, Macintosh and Web) while actually developing only one. In addition, if you need to use the database in local mode, you could open it directly, as is, with 4D.

To learn more about 4D Server, read the introductory sections of this manual, as well as the other sections that describe 4D Server in detail.

For a complete examination of the 4D environment, refer to:

  • The Design Reference manual to learn about designing and using 4D applications and databases.
  • The Language Reference manual to learn about the commands of the 4D language. For instance, to learn about the Web capability of 4D Server, read the section Web Server, Overview in this manual.

 
PROPERTIES 

Product: 4D
Theme: 4D Server in 10 minutes

 
ARTICLE USAGE

4D Server Reference ( 4D v13)
4D Server Reference ( 4D Server v12)
4D Server Reference ( 4D v14 R2)
4D Server Reference ( 4D v14)
4D Server Reference ( 4D v14 R3)
4D Server Reference ( 4D Server v14 R4)

Parent of : Working Concurrently with 4D Server ( 4D Server v11 SQL Release 6)