Win a copy of Event Streams in Action this week in the Java in General forum!

Red Marshall

Greenhorn
+ Follow
since Oct 03, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Red Marshall

thanks for the post

my follow up reply is still concerning me however. Its possible that 2 or more instances of this system will be running..each using different db files.

But this is prob ok if your program dosnt allow this - hopefully.

Does your business methods in the non-networked mode call any of the locking methods?

i.e.

book()
{
dataInstance.lock()
..processing
dataInstance.unlock()
}

my design at moment means that the data.java methods create/update/delete assume that only 1 client is calling the method at that time. So i was going to handle all the locking within the business methods. (Bad?)

In that case whats the point of using locking at all in the business methods for the non-networked mode.

all the best,

red
I just came up with another brain teaser

scenario: My data.java is a singleton..i've done because it seemed logical as 2 clients accessing the same db file must be using the same instance of data.java.

but what happens when you have 2 clients, accessing different db files? The singleton pattern no longer works as 2 distinct instances of data.java are now needed for each db file.

There is a workaround to this by modifying the singleton pattern so that data.java now has a static map of data.java instances where the key is the db filename.

This seems like overkill..ne thoughts?
Hi all,

i've just had a thought regarding URLyBird and the non-networked mode and locking. It seems silly to think that in non-networked mode theres any use at all for locking records - i'm assuming that in this mode, theres only ever 1 client running and the db is not being shared.

So in my biz tier classes (book, search) my local biz class wont use the locking methods provided by the Data class at all.

However it just occured to me..what if a client in non-networked mode is running on the same machine as the server, and both are using the same database file? Has anyone considered this?

I'd really like to know if any thinks that any book() call should use locking, regardless of whether the client is in non-networked mode.

Regards,

Red