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

lock/unlock for local cliend

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we need lock/unlock in local mode. i dont it is neccessary.
In local mode, iam planning to have my client invoke bookseats directly from Data
In Remote , server detects bookSeat call from client, it calls
lock()
bookSeats(0
unlock().
will there be any problem with Sun ? pls comment on this design.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No you do not need lock and unlcok for local access. Since that client is the nly one that has the database or could ever have access to the database.
Mark
 
Terry McKee
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You know...that's what I thought, but I tried recently running the local client and running a remote client with the server pointing to the same file that the local client is and surprisingly both clients are accessing the same file. Any thoughts?
 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont understand why should we run the client as local & remote at the same time ? in real time scenario that is not going to happen. moreover there is going to only one instance of server sitting and accessing the db file.
iam planning to code like this;
client (bookseats) -----> Data(bookseats) LOCAL
client (bookseats) -----> Server(bookseats) ---->
Data(lock)
Data(bookseats)
Data(unlock) REMOTE MODE
what do u guys think abt it?
 
Terry McKee
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not saying that there would ever be a reason to run Local and Remote at the same time. I'm just surprised that their is no error when you try it. I am not going to change my design at this point though. Anyone else think about this?
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont get it??? Isnt the file you supply when your server startup the same one as the one you supply for the client local access. It is on the same machine and therefore will be the same database. You can have more than one Data class accessing the same file. Its like a Random access file.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, Who's on first.
If both the server and the client are on the same machine, they probably most likely access the same db.db file.
But if the Server is on one machine and the client is on a differenct machine, both should have it's own db.db file. If you run the client in local it uses the db.db file on the local machine, if it runs remotely, then it is accessing the db.db file on the server's machine indirectly through out Facade/Adapter/Data Access interface.
client (bookseats) -----> Data(bookseats) LOCAL
client (bookseats) -----> Server(bookseats) ---->
Data(lock)
Data(bookseats)
Data(unlock) REMOTE MODE

Yep that like it should be. From an higher up looking down way
Mark
 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mark,
can u pls explain me if liked my idea or not. ur answer is confusing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic