• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

B&S: SecurityException in DB interface spec

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic