Originally posted by Reza Rahman:
Although it isn't absolutely essential, I'd like extend the DB interface to add a few more methods (most notably for resource cleanup because I'll be using synchronous I/O instead of caching in to make the database server less susceptible to sudden JM crashes). Since the Data class will still indirectly implement the unmodified DB interface, I should still be OK right?
Originally posted by Frank Verbruggen:
When name/location pair is already known in the database,
of when all fields (except the "booked" field) match the input.
This is very unclear to me since NOTHING in the DB file specifies name/location as the key for a record !
Originally posted by Andy Zhu:
I can't imagine: after 4 weeks of essay, I am still waiting and endless. The website shows pending for result. How long do I need to wait?
Just out of curiousity, why did you chooese HashMap over Hashtable?
Are you synchronizing on your HashMap within your update method? If so, why? It makes no sense to me to do such if all you are doing is a lookup. My understanding is that you should only synchronize the HashMap (or whatever locking structure you may have) during times you plan to delete (during unlock) or add (during lock) operations.
If multiple threads access this map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally.
Again, I'm not sure what you mean by this. Are you talking about your unlock record operation? Also, shouldn't unlockRecord handle the deletion of the locked record number?
I was lead to believe that that made a whole lot of difference.
a bunch of books and some people keep on warning about processes locking records and never releasing them.
What I'm wondering, did u also use a lot of objects,
or did u prefer a fast primitive typed solution ?
I'm wondering, what did u do to avoid that a record be locked forever when it is locked by a process and then that process dies.
It can never release its lock then ?