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

Locking in Local/Network mode

 
Kees van Oosterhout
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all i want to say hello to everybody on the ranch here. This is my first post, i hope it will be my last.
At the moment I am trying to pass the Developers Exam and learn something on the way. I have read several posts at the forum, as well as reading some of the chapters of the Sybex certification book.
I am confused about the locking system described on the forum. It seems that there is no need for locking operating in 'local' mode. Why is this? I assigned a thread for every action my gui will perform. Unless I am mistaking, this too can cause data corruption.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Clint"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it
here.
Thanks! and welcome to the JavaRanch! And don't make this your last post. You are very welcome here, and look forward to being able to help you as much as possible.
Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, having a new thread spawned after every Action could cause that problem. If you are letting the local mode do this to, and two seperate threads could access the same Data class and db.db file.
So my question would be why spawn a new thread for each action? While in the real world that will speed things up a bit, and make your system MDI capable, your really don't need that flexibilty in this assignment. It won't make you lose points, but it probably won't add points either.
Mark
 
Matthew Comer
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mark,
Maybe his name really is Clint Eastwood? It's possible (grin).
Matt
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I know, it is possible. However, when there seems to be an obvious ficticious name, I have to reply that way.
Mark
 
Kees van Oosterhout
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again. As you can see, i have changed the obvious 'ranch' name to my real name.
Mark: Thanx for your reply. I think I will use the Swing event thread for performing the action. It will hold up any user interaction until the action completes. This will avoid any data corruption, I think.

Matthew: Thanx for your support. I could well be my real name, for my lastname translated from dutch to english is "Eastwood"...
Greetz,
Kees (Clint)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic