| Sam, See Sean's note. The User object is a stateful object, meant to be used in a situation where only one user is going to be using it at a time... so it's perfect for the session scope. In effect, a record object IS a per-user value. User.getUserID() returns a number, related to one row in a table... so there can only be one user's data in that record at a time. By definition that makes it unsharable between users... If you're going to use it in the controller or the application scope you're going to have to deal with locking to make sure that and bear the brunt of fun-making, insults, beratement, belittlement, and abuse. ;) Kidding... even locking may not help you. Hehe... it can be made to work, yes, but it's far from ideal. Put the reactor factory in the controller's variables scope and call getSessionFacade().set("User",getReactorFactory().createRecord("User")) instead. Then you don't have to protect User 12314 from seeing the data from User 15345. And without proper locking in place (which will drastically degrade the performance of your application under load), it's not just bad form... it means that one user's data might get written to another user's record if there's any overlap between 2 or more requests. It's downright dangerous. Collisions may be rare, but they're devastating when they happen. Laterz, J ------------------------------------------------ Jared C. Rypka-Hauer Continuum Media Group LLC Member, Team Macromedia - ColdFusion "That which does not kill me makes me stranger." - Yonah Schmeidler On Apr 18, 2006, at 7:23 PM, Sam Clement wrote:
|
- Re: [Reactor For CF] Scoping (was New Commit committed) Jared Rypka-Hauer

