This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages forum!

Al McGreavy

+ Follow
since May 23, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Al McGreavy

Ok Barry, point taken.

It's not "entirely" fictitious as most people call me 'Al' and 'McG' is shortish for my surname. However, point taken, I have changed my displayed name to my real name.



I had everything working fine in both local and networked mode and realised I have omitted something!! Argh!

I have a Data class implementing a DB interface. This interface includes lock and unlock methods and has other methods requiring lockCookies ie.

public void update(int recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException;

My Data class is a facade to a LockHandler for all locking and a FileHandler for all database operations.

I have a DataService class as an adapter to the Data class. This implements another interface, Database and it is this that exposes methods to the client (all locking is on the server). It is also a singleton so that the Data class can be extended in the future.

My local mode is working through the DataService and thus my local mode uses locking as well as the networked mode at the moment.

I can't think of a way round this just now other than having another class, say, LocalDataService to implement the Database interface as well but which creates an instance of FileHandler and not the Data class so that no locking is employed. So, local mode would create a LocalDataService with no locking and networked mode would create a DataService (Rename this to RemoteDataService) with locking.

I'm not so sure about this approach. Would you please advise your thoughts on this.

Many thanks

[ August 17, 2007: Message edited by: Al McG ]