The first thing I would check is to make sure you have a primary key set in that table, is ID marked as the pm?
On 8/7/06, Ray West <
[EMAIL PROTECTED]> wrote:
Hi, I am having a similar problem to Tom below. Using SQL Server and a
numeric Identity column, I can load a record, verify that it is loaded
correctly, change something and save() and it ALWAYS creates a new
record. Code is below.
In the body section below, the first cfoutput shows the correct info,
but the second after the save shows a new ID that was created by the
Identity column in the DB on save().
<!--- create the reactorFactory --->
<cfset Reactor = CreateObject("Component",
"reactor.reactorFactory").init(expandPath("reactor.xml")) />
<!--- create a userGateway --->
<cfset User = Reactor.createRecord("Company").load(ID=2) />
<cfset User.setDBA("Test DBA") />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<!--- dump the results --->
<cfoutput>#User.getID()# #User.getName()# #User.getDBA()#</cfoutput><br />
<cfset User.save() />
<cfoutput>#User.getID()# #User.getName()# #User.getDBA()#</cfoutput>
</body>
</html>
Any help is appreciated.
Ray
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Dan Vega
[EMAIL PROTECTED]
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
