• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

locking

 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everybody!
I am beginning to write the lock and unlock and I am a little confused here. From what I understand from the many posts that I have read here, is that, Rmi does not do a good job remembering which threads are associated with which requests. Do I need to really worry about that? What has RMI got to do with the application layer(which has the logic and which talks to the database). Please see below

My confusion is that while implementing the lock and the unlock, I am thinking of maintaining a stack of all the requests that came in to write to the database (since that would need a write lock). For doing the above, I need 2 things
1) I need a java.util to keep a stack of all the threads on a First in, First out basis
2) I need to make a reference to the current thread to do that.
My question is on point no 2. If there are 2 users trying to book a ticket and both of them are at a space of 2 minutes. Why should there be a problem with the Thread.currentThread reference. If I am understanding the posts correctly this should not be done.Why is that?
One thing that I have read about the developer certification is "dont read in between the instructions". What do you guys think? Am I thinking too much on point no 2. I know on person who did his programming assignment differently. He did make a reference to the current thread and he got his certification.
Did I make a mistake in understanding the posts?
 
Prakash Krishnamurthy
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
friends,
Do tell me what your comments are.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic