File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Multiple servers start scenario Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Multiple servers start scenario" Watch "Multiple servers start scenario" New topic

Multiple servers start scenario

Liviu Carausu
Ranch Hand

Joined: Oct 07, 2004
Posts: 159
Have you take precautions measures against multiple starts of the server using the same database file or the same service name ?
Do you think it is necessary to obtain a lock on the database file ?

Oracle Certified Master Java SE6 Developer(SCJD),
OCE JEE 6 JSP and Servlets Developer.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

Hi Liviu,

Search your instructions for something like "You may assume that at any moment, at most one program is accessing the database file" - if you have that, then you don't need to worry about multiple starts of the server.

Also - check the APIs for file level locking - you should find a warning against this (at least if you want "write once, run everywhere" functionality).

Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
I agree. Here's the link:
subject: Multiple servers start scenario
jQuery in Action, 3rd edition