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

Local mode == one client?

 
S Perreault
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it okay to assume that in local mode, only one client will be accessing the database at one time?

Thanks!
Perogi.
 
Denis Spirin
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can find the answer in your instructions.html:

You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Local mode is one client, NO server.

Mark
 
S Perreault
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for your replies.

Just to drill it into my thick head.

You may assume that at any moment, at most one program is accessing the database file; therefore your locking system only needs to be concerned with multiple concurrent clients of your server.


Heh, yeah I've read this about a dozen times. I honestly believe that each section is written by a different person. I have seen terrible specifications before but nothing like the scrap that comes with this cert.

I gather that this means:

Local
-----
ClientUI -> DataLayer -> Database

RMI/Sockets
-----------
ClientUI -> \
ClientUI -> - -> RMI/Socket Server -> DataLayer -> Database
ClientUI -> /

Am I correct or very offbase.

Thanks for your time!
Perogi.
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, I think your graph is quite informative. I kind have a similar picture of my assignment. Only difference is that what you mean the datalayer may be the data server. I haven't program the server part and know that client in alone mode really doesn't need start up server however, I think many code in server can be used in this mode.
 
S Perreault
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy,

My Datalayer is where I store all of the business logic (including locking and unlocking of records). I also only use Contractor Objects (Javabeans) on the Client side and String[] on the server side. This layer translates between the two.

I've been testing threading and if the above graph is correct, then I am good to go for deadlock, critical sections, etc.

My goal is to have blocking at the minimum possible. However, it seems to me that it would be better to have non-optimal blocking and no risk of deadlock. I am not too strong on threading.

Perogi.
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, S Perreault:

How often do you check the magic value of db file? Do I need to worry about it so that each time when I have a read/write to it I need to check it or simply when user updates file location?

I am learning too. So far, still have fun about it but it seems it will take longer time than I expected.
 
S Perreault
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy,

I am only checking it the first time the client or server connects to the database. Since that file should not change (besides updates/deletes), the magic value shouldn't either.

I am using it basically as a test to ensure that the database file that is being opened is a 'Contractor' database file (for my project).

Perogi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic