Re: Can I use the same instance of an object for all sessions?

2006-03-23 Thread Aaron Rouse
"Not now I'm multitasking" > > -Original Message- > From: Aaron Rouse [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 23, 2006 9:14 AM > To: CF-Talk > Subject: Re: Can I use the same instance of an object for all sessions? > > Something like > > Applica

RE: Can I use the same instance of an object for all sessions?

2006-03-23 Thread Kevin Penny
ot now I'm multitasking" -Original Message- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Thursday, March 23, 2006 9:14 AM To: CF-Talk Subject: Re: Can I use the same instance of an object for all sessions? Something like Application.cfm Application.DAO = CreateObject(&q

Re: Can I use the same instance of an object for all sessions?

2006-03-23 Thread Aaron Rouse
Something like Application.cfm Application.DAO = CreateObject("Component", "some.DAO"); SomePage.cfm set App.DAO = Application.DAO; App.DAO.Read(Session.SomeID); Actually the copy into another scope happens at the bottom of the application.cfm since it is ran for every page. The copy also is wi

Re: Can I use the same instance of an object for all sessions?

2006-03-23 Thread Troy Simpson
Aaron, Thank you for response. So let me see if I have this correct. An example of your code would be something like this: application.cfm: application.dao = createObject("component","some.dao"); Then some where in your code you might have some onCreateNewSession: session.dao = application.dao;

Re: Can I use the same instance of an object for all sessions?

2006-03-22 Thread Aaron Rouse
I do this but with one exception, I copy it from the application scope to a local scope then do the inserts, updates, etc. I think if you left it in the application scope then you probably would need to do a cflock and that would seem to lead to contribute to issues when a query might take awhile