Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sockets

 
Keith Jones
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just started the exam and I don't understand a few things.

1. Apparantly, we have to write to and read from the database file they provided. Is this right?
2. Am I right in saying we don't actually use a database like Access, SQL Server or anything like that and that we don't use JDBC?
3. If we don't use any database technology as mentioned in question 2 then how do we allow multiple concurrent accesses to the database file? Surely, only 1 thread can access (read, modify) the file at one time?

Thanks
 
Jeremy Botha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Correct
2) Correct. No RDBMS systems allowed, and definitely no JDBC allowed.
3) That's probably one of the cruxes of the programming assignment

If you have a look at the interface for the database class you have to implement, it should specify two methods ( lock(...) and unlock(...) ). You need to implement these two methods and then make use of them to allow multithreaded access onto the data file.

Thread handling counts for 20% of the final mark for the programming assignment.

Jeremy
 
Keith Jones
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3. I understand that we have to use the use the lock and unlock method but here's the thing. These two methods are for locking a single record in the file, however, there is only 1 file and only 1 process and read or write to that file at one time.
 
Jeremy Botha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I understood the documentation in my project to imply was that only one thread could access the file at any one time, but that multiple threads had to be able to request data asynchronously off the file at the same time, and that my Database implementation had to handle syncrhonization of the data file in order to provide thread-safe access onto the data.

So I can have a multithreaded asynchronous server object where multiple request processing threads access the database through the Data object, which handles synchronization, locking of records, and resource availability notification within itself.

Jeremy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic