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

B&S: SecurityException in DB interface spec

 
Tom Holt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The DB interface I am forced to implement says that a SecurityException should be thrown when the record is locked with a cookie other than the cookie passed. Does this mean I should use a SecurityManager to manage the locking and unlocking of contractor records?

I am concerned about doing this for the following reason:
In my 'RMI Restrictions' it says that "You must not require the installation of a security manager" - Does this requirement just relate to RMI or the whole app?

I would rather not throw a SecurityException but keep my thread waiting until the resource has been released.

Some guidance would be appreciated!
 
Wim van Haaren
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tom,

You should not use a security manager. This SecurityException has nothing to do with RMI.

What the interface is saying is that a SecurityException should be thrown if a client tries to call update() or delete() on a record without it holding a lock on that record.
A client cannot update or delete a record without first acquiring a lock on it in the lock() method. If it cannot get a lock it will just have to wait in the lock() method for the record to be unlocked.

Hope this makes any sence.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic