[Prev] Thread [Next]  |  [Prev] Date [Next]

[Mach-II] CF 9 ORM & Mach-II Eric Cobb Wed Apr 04 06:09:34 2012

I'm finally getting a chance to play with CF 9's ORM, and I'm having a 
problem getting it to work in my Mach-II app.  My example is pretty simple, 
so I'm hoping that there's just something that I don't have configured 
correctly and someone here can offer me some pointers.  All I'm trying to 
do is insert a Name, Email, and Password from a form into an already 
created DB table.

Here is what I have so far:


<cffunction name="saveUser" output="false" access="public" 
returntype="void" hint="I create/update a user's information">
        <cfargument name="event" type="MachII.framework.Event" 
required="true" />
        <cfset getuserService().save(arguments.event.getArgs()) />    


<cffunction name="save" access="public" output="false" returntype="void">
        <cfargument name="userInfo" type="struct" required="true">
            <cfset var objUser = EntityNew("user")>
            <cfset objUser.setid(createuuid())>
            <cfset objUser.setemail(arguments.userInfo.email)>
            <cfset objUser.setpassword(arguments.userInfo.password)>
            <cfset objUser.setname(arguments.userInfo.name)>

            <cfset EntitySave(objUser,true)>

            <cfcatch type="any">
                <cfdump var="#cfcatch#">

Pretty straight forward, right?  For whatever reason, I can't get 
EntitySave() to work.  I don't get an error, the browser just spins and 
spins until CF eventually times out.  If I put a dump just before 
EntitySave() all of the data is there and correct. my ORM CFC is pretty 
basic, too:


<cfcomponent displayname="user" output="false" persistent="true" 
    <cfproperty name="id" type="uuid" fieldtype="id" generator="uuid">
    <cfproperty name="email">
    <cfproperty name="password">
    <cfproperty name="name">

I'm not sure if it matters, but here are the settings from my 
Application.cfc file:

<cfset this.ormenabled = "true"> 
<cfset this.datasource = "myDsn">
<cfset this.ormsettings = {cfclocation="model/orm",dialect="MySQL"}>

So, does anyone have any idea as to what could be going on?  Am I missing 
some settings or code somewhere?  Since I'm not getting any type of error, 
and this is my first time fooling with ORM, I'm kinda at a loss as to what 
to look for.


Eric Cobb

To post to this group, send email to [EMAIL PROTECTED]
For more options and to unsubscribe, visit this group at 

SVN: http://svn.mach-ii.com/machii/
Wiki / Documentation / Tickets: http://trac.mach-ii.com/machii/