Connecting to database on different machines

Chris Kelleher

Administrator
Staff member
Progress version 7.3e on both machines.
1 machine running HP Unix and I think the other one is a Sun.
I need to write some programs that prompt a user for some information, then update 2 separate Progress databases on 2 different machines.
The user will have already logged on to one database, so I just need to clearly understand the process of how to connect to the database on the other machine. I've read the manuals but am still not sure what is all involved. I want to make sure I do it the right way so if one of the machines crashes, the databases will be recoverable.
From what I understand, information needs to be added to the /etc/hosts, etc/services, and etc/SomethingElseICantRememberRightNow.
Then using the CONNECT statement I should be able to do what I need as long as I qualify the fields as dbname.filename.fieldname. I'm sure I am missing somethings. Thanks for any help you can give.
ProgressTalk is a great forum! Good Job!
 

Chris Kelleher

Administrator
Staff member
Hi Mark,

This isn't too difficult to set up. First edit the /etc/hosts on both systems. There should be a line for each in the file on both machines. (Of course these might already be there, but it's always good to check)...

Add entries like:
192.200.50.1 machine1.domain.com machine1
192.200.50.2 machine2.domain.com machine2

You should be able to ping machine1 and machine2 at this point to make should the networking is all ok.

You'll then want to edit the /etc/services file as well, to define the sockets that Progress will use.

Your entries should be something like:
sports1 12010/tcp # Sports1 database test
sports2 12020/tcp # Sports2 database test

Now your ready to connect. You need to connect to the sports2 before running any code that referances it. So I would make a small program just to handle the connection, and you should be able to say CONNECT -db sports2 -H machine2 -S sports2 -N TCP and away you go!

Just a couple words of wisdom: The connection can take a few seconds, so it's a good idea to warn to user if this is going to be interactive. You could also use the AUTO-CONNECT feature but I always recommend against it.

Also your transaction could be commited to one database and not the other if something happens, ie: machine2 goes down. You should look into enabling 2-Phase commit to get around this, however enabling this WILL HURT performance.

HTH.

-Chris
 
Top