Using a Session Facade to handle evolving session variables
Last year I started at a company where two major projects were underway: Create a new payment application using Mach-II, then Redesign and overhaul the website. The payment application would have to work in both the current and upcoming versions of the website.









http://www.mail-archive.com/cfcdev@cfczone.org/msg...
<quote>
..Now we can safely output #request.SessionFacade.getUser.get*()# anywhere on the page. The session.user object is read using a lock inside SessionFacade.getUser().
</quote>
Can you explain how locking only SessionFacade.getUser() is safe? Shouldn't the facade also use locking when calling methods of the session.user object, like the facade in this post?
<cffunction name="getUserID" returntype="numeric" hint="Logged-in user's ID">
..
<cflock scope="session" type="readonly" timeout="1">
<!--- New object variable --->
<cfset userID = session.user.getUserID() />
</cflock>
..
</cffunction>
That last section of code had
WHERE userID = #variables.SessionFacade.getUserID()#
and has been updated to
WHERE userID = #variables.SessionFacade.getUser().getUserID()#
Sorry about that.
Cheers