wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes how does the program start? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "how does the program start?" Watch "how does the program start?" New topic
Author

how does the program start?

Clivant Yeo
Ranch Hand

Joined: May 22, 2004
Posts: 124
Hi ranchers,

As I seen from other posts, the alone mode of the program is single user, no network client will access the local database right? That is fine. But take a look at the network mode, it says that somewhere there must be a database server being started up and the GUI program must specify the location to the database using the IP address of the database.

But how is that database that the network client will access get started up. I feel that there should be one alone program being started up in which it will accept network connections, it is just that the local GUI client got to access the database directly, right? Anyone can correct me if I am wrong and give me a solution on this issue.

Thanks in advance


Clivant Yeo
My Personal Website
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Clivant,

But how is that database that the network client will access get started up. I feel that there should be one alone program being started up in which it will accept network connections, it is just that the local GUI client got to access the database directly, right? Anyone can correct me if I am wrong and give me a solution on this issue.


The server opens its database exactly the same way a stand-alone client does. Where is the issue? (I'm not sure I understand your question).

Regards,

Phil.
Andy Zhu
Ranch Hand

Joined: May 26, 2004
Posts: 145
I have a similar question regarding the mode (B&S 2.2.2), in a different way. My instruction doesn't say: when a client (should be along with db server) runs in alone mode, it should be the only single instance of client accessing to the db server.

Actually thread through the relevant info in instruction:
1. since there is only one package deployed, client/db server/network server bundled together. And there is only one form of command line to execute this program, which gives the following conclusion/confusion: the mode not only instructs the behavior of clients, but also possibly the db server.
2. when a client fires up in alone mode, it executes with db server; actually, they are just a single process.
3. in server mode, I tend to think that it should just fire a client (I may be wrong). It makes no sense that a client starts its own db server but never use it. Therefore, a db server seems always fired by an alone-mode client.
4. but my confusion is this: I understand that two clients can be fired on the same machine. Would this be the case: these two clients are both in alone mode but use the same xx.db file? In this case, two db servers are fired. (I tend to say no, see 5)
5. In addition, in my Locking section of instruction, it says "you may assume that at any moment, at most one program is accessing the database file; ...". My understanding is this: it is only the db server in this 3-tier/2-tier model that access to xx.db, so it implies that there can be only one client claims alone mode (we assume and don't check this) and this gives me the guess to 4.

6. If my previous understand is correctly, then I can conclude: in any successful run of the program, there must be one and only one client run in alone mode.

Furthermore, if a client starts in a server mode, can I make assumption of that server has been started? Or I should just quit if I found specified server doesnot exist yet?

So many uncertainty from instruction. Well this is also the fun part.

Thanks for any comments


--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
1. since there is only one package deployed, client/db server/network server bundled together. And there is only one form of command line to execute this program, which gives the following conclusion/confusion: the mode not only instructs the behavior of clients, but also possibly the db server.

Yes

2. when a client fires up in alone mode, it executes with db server; actually, they are just a single process.

Yes

3. in server mode, I tend to think that it should just fire a client (I may be wrong). It makes no sense that a client starts its own db server but never use it. Therefore, a db server seems always fired by an alone-mode client.

In server mode, there is only 1 server running.There could be multiple clients running and connecting to this same server. This server could either be running on the same machine as the clients or on a different machine. Every client does not have it's own server.

4. but my confusion is this: I understand that two clients can be fired on the same machine. Would this be the case: these two clients are both in alone mode but use the same xx.db file? In this case, two db servers are fired. (I tend to say no, see 5)

No. In standalone mode, there is only 1 program(which is both server/client) running on the machine at a time.I think we would be safe enough to assume and document this.

5. In addition, in my Locking section of instruction, it says "you may assume that at any moment, at most one program is accessing the database file; ...". My understanding is this: it is only the db server in this 3-tier/2-tier model that access to xx.db, so it implies that there can be only one client claims alone mode (we assume and don't check this) and this gives me the guess to 4.

Yes

6. If my previous understand is correctly, then I can conclude: in any successful run of the program, there must be one and only one client run in alone mode.

Yes

Furthermore, if a client starts in a server mode, can I make assumption of that server has been started? Or I should just quit if I found specified server doesnot exist yet?

Well...my specs also do not say anything about this. It depends on how you want it.It is purely your choice.I am going to throw up a useful message to the client that the Server is unavailable. Please try later kind of a polite message and quit.

So many uncertainty from instruction. Well this is also the fun part.

Yes
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how does the program start?
 
Similar Threads
Locking
about the "server" instructions
commandline argument
B&S suncertify.properties
How many modes are there for the program?