Do you have a cfparam at the top of that setting the initialised variable?
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Gavin Baumanis Sent: Friday, 17 April 2009 3:56 PM To: cfaussie Subject: [cfaussie] Session / application scope management. Hi Everyone, I am working on a nice small project and using it as a learning aid for Coldspring and OOP in general. At the moment, I am creating all of me coldspring beans and manager / gateway CFC's as singletons, with the code below. In this configuration, concurrent sessions are infecting each other's records. if I remove the CFIF's no such contamination occurs. Which is the weird part. (well to me anyway). Is there anything that stands out that I am doing wrong? And If you need anything else, I.e. the gateway calls or anything, just let me know and I willpost up any missing information you might require. Thanks! <cfif not isDefined("application.initialised") OR application.initialised EQ false> <!--- Initialize ColdSpring ---> <cfset coldspringConfig = 'coldspring.xml' /> <cfset properties = StructNew() /> <cfset properties.dsnName = "itw" /> <cfset application.beanFactory = CreateObject('component', 'coldspring.beans.DefaultXmlBeanFactory').init (defaultProperties=properties) /> <cfset application.beanFactory.loadBeans(coldspringConfig) /> <cfset application.userManager = application.beanFactory.getBean ('userManager') /> <!--- Get the User Service CFC from ColdSpring. --- > <cfset application.userGateway = application.userManager.getUserGateway() /> <!--- Now get the Gateway that ColdSpring set into the User Service.---> <!--- Initialise the Questions ---> <cfset application.questionManager = application.beanFactory.getBean ('questionManager') /> <cfset application.questionGateway = application.questionManager.getQuestionGateway() /> <cfset application.answerManager = application.beanFactory.getBean ('answerManager') /> <cfset application.answerGateway = application.answerManager.getAnswerGateway() /> <cfset application.definitionManager = application.beanFactory.getBean ('definitionManager') /> <cfset application.definitionGateway = application.definitionManager.getDefinitionGateway() /> <!--- Initialise the assessment ---> <cfset application.assessmentManager = application.beanFactory.getBean ('assessmentManager') /> <cfset application.assessmentGateway = application.assessmentManager.getassessmentGateway() /> <!--- Create the pages object ---> <cfset application.pageManager = application.beanFactory.getBean ('pageManager') /> <cfset application.pageGateway = application.pageManager.getPageGateway() /> <cfset application.initialised = true> </cfif> <cfinclude template="../fusebox5/fusebox5.cfm" /> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---
