Thanks Brian,
I am indeed proceeding with caution. I plan to implement Reactor on a
very simple application.
I have had a brief look at ColdSpring and when I get some time I will
have a play with it. I am not sure my CFC's up to this point would play
well with ColdSpring. I think there are lots of places where I
could/should move methods into their own cfc!
With regard to placing the Reactor factory into the application scope am
I safe in assuming that if I have a User table in my db and I have 2
users in this table that if one user calls this:
<cfset User = reactor.createRecord(“User”).load(userId=1)>
and then the second user calls:
<cfset User = reactor.createRecord(“User”).load(userId=2)>
and then one of the users does this:
User.getFirstName()
It will only return the User.FirstName belonging to their userId?
Thanks for the clarification, the docs need some work for the more
novice reactor users!!
Cheers,
Dave
Brian Kotek wrote:
I use ColdSpring to handle creation of the Reactor factory, and also use
ColdSpring to get instances of the DAOs and Gateways that get passed
into my Service objects. So you may want to look at ColdSpring.
Otherwise, yes you can keep the factory in the application scope. I
believe that the Singleton objects that Reactor creates (DAOs and
Gateways) are cached inside Reactor, so if you call for a specific
gateway and Reactor has already created it, you will get back that
instance, not a new instance.
However, if you don't completely understand what you're doing and what
happens when you place things into shared scopes, you're going to want
to be careful. This can be a really confusing topic, but it is also be
very important. You don't want to just run around jamming everything
into the application scope, because unless you do it carefully you CAN
have separate threads overwriting data that other threads are using. So
the message here would be: proceed with caution.
On 7/16/07, *Dave Phipps* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
I have managed to convince our db admin to move this db over to the
MySQL 5+ box. This will make life so much easier!!
Thanks again for the suggestions.
What do you guys do for persisting the reactorfactory. Do you put it in
the Application scope? I have mine in the application scope but wonder
how this works with multiple users, do the singletons that reactor
creates apply to each user or will one user overwrite another?
Do I need to use the session scope for reactor instead? Or am I
misunderstanding how reactor/cfcs function?
Cheers,
Dave
David Phipps wrote:
> Thanks Jeff. Our main servers use MySQL 5 but we are running an old
> legacy machine which this project requires! I have installed the
db on
> my local machine (MySQL 5) and I'll see if I can get it working.
>
> Cheers,
>
> Dave
>
> Jeff Roberson wrote:
>> If you are going to upgrade mySQL. Skip 4.1 and go right to
5. There
>> are son significant changes from 3 to 4.1 in data typing that
are a pain.
>>
>> But good luck :)
>>
>> On Jul 13, 2007, at 1:24 PM, David Phipps wrote:
>>
>>> Brian, I didn't think that the difference between 3 and 4 was that
>>> significant so I was hoping it would work. I am not sure I can get
>>> the db admin to upgrade as it is on an old box.
>>>
>>> Dave, no BlueDragon, just testing on CF8 at the moment.
>>>
>>> I am going to try and export the database and run it locally as it
>>> could be a network issue for reactor when in development mode.
>>>
>>> Cheers,
>>>
>>> Dave
>>>
>>> Dave Shuck wrote:
>>>> Are you using BlueDragon by any chance? When I did some testing
>>>> with JX7, I found that I had to change...
>>>> <object name="Foo" />
>>>> ...to...
>>>> <object name="Foo"></object>
>>>> ~Dave
>>>> On 7/13/07, *David Phipps* < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>>>> <mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>> wrote:
>>>> Hi,
>>>> I am just starting a new project and I thought I would give
>>>> Reactor a
>>>> try. I played with one of the demo apps and it seemed pretty
>>>> straightforward. Now that I have plugged Reactor into my
new app
>>>> I am
>>>> running into a problem.
>>>> I am doing some very basic tests at the moment as the
database is
>>>> running on MySQL 3 and I am not sure if Reactor can go
down that
>>>> low.
>>>> Here is the objects part of my reactor.xml:
>>>> <objects>
>>>> <object name="web_districts">
>>>> <hasMany name="web_circuits">
>>>> <relate from="District_ID" to="District_id" />
>>>> </hasMany>
>>>> </object>
>>>> <object name="web_circuits" />
>>>> </objects>
>>>> I then have the following in my display file:
>>>> <cfset District
>>>>
>>>>
=application.reactor.createRecord('web_districts').load(District_ID=113)>
>>>>
>>>> <cfset CircuitIterator = District.getweb_circuitsIterator()>
>>>> <cfoutput>#District.getDistrict_Name()#</cfoutput><br />
>>>> <cfloop condition="#CircuitIterator.hasMore()#">
>>>> <cfset Circuit = CircuitIterator.getNext() />
>>>> <cfoutput><p>#Circuit.getCircuitno()# -
>>>> #Circuit.getCircuit_Name()#</p></cfoutput>
>>>> </cfloop>
>>>> The first bit: District.getDistrict_Name() works fine.
>>>> The second bit - the iterator - falls over with one of the
>>>> following
>>>> error messages:
>>>> Object 'web_circuits' does not exist
>>>> or
>>>> CFQUERY exceeded the timeout
>>>> The table web_circuits does exist and on one page reload I
>>>> actually got
>>>> some output but I had forgotten my cfoutput tags! I reloaded
>>>> again and
>>>> the errors were back.
>>>> Are the table names a problem (I didn't create the db!) or is
>>>> MySQL 3
>>>> just not up to handling requests from Reactor?
>>>> Also is it normal in development mode to see lots of the same
>>>> query:
>>>> qObject (Datasource=dsn7, Time=273ms, Records=1) in
>>>>
>>>>
/Applications/ColdFusion8/wwwroot/reactor/data/mysql4/ObjectDao.cfc @
>>>> 16:24:28.028
>>>> SELECT database() as DATABASE_NAME
>>>> Sorry for all the questions.
>>>> Many thanks for any help that can be offered.
>>>> Cheers,
>>>> Dave
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> -- --
>>>> -- -- -- --
>>>> Reactor for ColdFusion Mailing List
>>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
<mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>>>> Archives at:
http://www.mail-archive.com/reactor%40doughughes.net/
<http://www.mail-archive.com/reactor%40doughughes.net/>
>>>> <http://www.mail-archive.com/reactor%40doughughes.net/>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>>>> -- --
>>>> -- -- -- --
>>>> --
>>>> ~Dave Shuck
>>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> <mailto:
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>>>> http://daveshuck.instantspot.com
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>>>> -- -- -- --
>>>> Reactor for ColdFusion Mailing List
>>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>>> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>>>> -- -- -- --
>>>
>>> --
>>>
>>>
_______________________________________________________________________
>>> David Phipps, Director
>>> [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>>>
>>> Chapel Studios / London
>>> T +44 (0)20 7100 6980 F +44 (0)20 7100 6981 M +44 (0)7931
375040
>>> New Broad Street House, 35 New Broad Street, London, EC2M
1NH, UK
>>>
>>> Visit our website: http://www.chapel-studios.co.uk
>>>
>>>
_______________________________________________________________________
>>>
>>> Chapel Studios is a limited company registered in England. The
>>> information in this email is confidential, intended solely
for the
>>> addressee, and may be legally privileged. If you are not the
>>> addressee
>>> or authorized to receive this for the addressee, you must not
>>> use, copy,
>>> disclose or take any action based upon this message or any
>>> information
>>> herein. If you have received this message in error, please
advise
>>> the sender immediately by reply e-mail.
>>>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>>> -- -- -- --
>>> Reactor for ColdFusion Mailing List
>>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>>> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>>> -- -- -- --
>>>
>>
>>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> -- -- -- --
>> Reactor for ColdFusion Mailing List
>> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
>> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
>> -- -- -- --
>>
>
--
David Phipps, Director
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
Chapel Studios / London
T +44 (0)20 7100 6980 F +44 (0)20 7100 6981 M +44 (0)7765 240899
New Broad Street House, 35 New Broad Street, London, EC2M 1NH, United
Kingdom
Visit our website: http://www.chapel-studios.co.uk
_____________________________________________________________________________
Chapel Studios is a limited company registered in England. The
information in this email is confidential, intended solely for the
addressee, and may be legally privileged. If you are not the addressee
or authorized to receive this for the addressee, you must not use,
copy,
disclose or take any action based upon this message or any information
herein. If you have received this message in error, please advise
the sender immediately by reply e-mail.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
<http://www.mail-archive.com/reactor%40doughughes.net/>
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- --
--
David Phipps, Director
[EMAIL PROTECTED]
Chapel Studios / London
T +44 (0)20 7100 6980 F +44 (0)20 7100 6981 M +44 (0)7765 240899
New Broad Street House, 35 New Broad Street, London, EC2M 1NH, United
Kingdom
Visit our website: http://www.chapel-studios.co.uk
_____________________________________________________________________________
Chapel Studios is a limited company registered in England. The
information in this email is confidential, intended solely for the
addressee, and may be legally privileged. If you are not the addressee
or authorized to receive this for the addressee, you must not use, copy,
disclose or take any action based upon this message or any information
herein. If you have received this message in error, please advise
the sender immediately by reply e-mail.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --