• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Locking in Local/Network mode

 
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.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
Posts: 17346
11
Mac IntelliJ IDE 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
 
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
Posts: 17346
11
Mac IntelliJ IDE 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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic