Hi Ray,
No joy so far. A couple of people have responded today which may help you
out. I think that, for some reason, Reactor tests to see if the field
isNumeric() when deciding whether to update() an existing record or create()
a new one.
It might be that you need to override the DAO update and create methods
(what's the point in using reactor if you've gotta do this?).
Chris Blackwell gave me the following response (Many thanks for this,
Chris):
----------------------------------------------
"I believe this is possible, if for example you use UUID's for your primary
key you can modify the objects TO to give it an new id whenever you
instantiate one.
Open the directory where reactor creates the customizable cfc, that's
/model/data in MG:U. In the TO directory edit the non db-specific cfc for
your object to initialise the primary key value. Something like this..
<cfcomponent hint="I am the database agnostic custom TO object for the User
object. I am generated, but not overwritten if I exist. You are safe to
edit me."
extends="reactor.project.myproject.To.UserTo">
<!--- Place custom code here, it will not be overwritten --->
<cfset this.userid = createuuid()>
</cfcomponent>
HTH
Cheers, Chris"
-------------------------------------------------
I'm afraid I've decided to post this reply back to both the Model Glue and
Reactor lists because:
1. you are the second person to have this problem
2. I couldn't get any reply on the Reactor mailing list (yes, I've already
subscribed)
3. This is an issue that might be relevant to Reactor users and Model Glue
users alike (as Model Glue Unity uses Reactor)
Many thanks for your respective replies Dave and Antony. Apologies for using
the Model Glue list for something so outrageously off topic as Reactor ;-)
Cheers,
Tom
-----Original Message-----
From: Ray West [mailto:[EMAIL PROTECTED]
Sent: 08 August 2006 01:51
To: [EMAIL PROTECTED]
Subject: [Reactor for CF] Problems with primary key in MS SQL
Hi Tom,
Did you have any luck with this? I am having a similar issue. Using an
Identity column in SQL Server I can load a record and verify that the
info is loaded and correct, change a field and save() and it ALWAYS
creates a new record rather than updating.
Any info would be appreciated.
Thanks,
Ray
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --