Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird's [Version 1.2.3] and lockCookie

 
Payal Shah
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
-Should i use locking in local mode?
-What is the lockCookie value in local mode?
Thank you.
 
Alberto Ridolfi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

As far as I understand it, he locking requirement is defined in the DB interface, and whether you are using the app in local or remote mode, your database requests are going to be made over this DB interface implementation that you are creating. Since the interface mandates that you use locking, you should use it, no distinction if you are in local mode or remote mode. Therefore, the cookie value in the local mode should be the same as in remote mode.

Cheers
 
Payal Shah
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok..So I read few posts saying use 0 or -1 for cookie value if you are in local mode, is not correct then rihgt?

thanks
Payal
 
Roberto Perillo
Bartender
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should i use locking in local mode?

Definitely. If you don't use it, you'll fail.
What is the lockCookie value in local mode?

This value has to be generated in your Data class (it is a long value in your case, isn't it?). You have to use it no matter if in local or networked mode.
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Payal Shah:
-Should i use locking in local mode?


I used it, I don't know it is a good choice or not, because in my assignment, the lock and unlock method is called before and after book the room no matter what the class used to access the database (because it accessed through interface)


Jeffry Kristianto Yanuar (Java Instructor) SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic