wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Making Data class Singleton.. Providing  the database consistency problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Making Data class Singleton.. Providing  the database consistency problem?" Watch "Making Data class Singleton.. Providing  the database consistency problem?" New topic
Author

Making Data class Singleton.. Providing the database consistency problem?

Ken Kirin
Greenhorn

Joined: Dec 02, 2004
Posts: 26
Hi All,

I have a question about the Data Singleton class. If I have to use the same Data class, which is in "suncertify.db" package, both in standalone mode and networked mode. Suppose that I run a server and I have a network client requesting a servie,the server knows which server database file(from suncertify.properties file) should be properly used for this networked mode and the Data Singleton class will be mapped to this server database file. While this should be no problem, if, at the same time, i run this application on this server machine that is servicing that network client, my Data Singleton class now will be mapped to my local database file(in my server machine) then this Data Singleton Class has no longer way to get back to the server database file to service that network client because the Data Singleton class is already mapped to different database file and there is only one instance of the Data class. How could you guys solve this problem? Should I not make the Data class Singleton but I will be raising the thread safe issue then???

Regards,
Ken Kirin
SCJP
SWCD
SCJD(B&S In progress)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Making Data class Singleton.. Providing the database consistency problem?
 
Similar Threads
standalone mode
NX: Non-Networked mode
on UI design :(
nx:All of URLy Bird1.1.3 about record lock
B&S: Need some clarification on the single mode flag