Hello, wondering if anyone can spot what I'm doing wrong:

This code:

    <cffunction name="saveUser" access="public" returntype="void"
output="false">
        <cfargument name="user" type="org.crowdvote.user.User"
required="true">
        <cfset var key = "" />
        <cfset var result = "" />

        <cflog text="UserGateway.cfc line 29 says
user.getId()=#user.getId()#" />

        <cfif user.getId() eq "">
            <cfset user.setId( createUUID() ) />
        <cfelse>
            <cfset result = googleDelete(arguments.user) />

            <cflog text="UserGateway.cfc line 36 says result=#result#" />


        </cfif>
        <cfset key = arguments.user.googleWrite("user") />

        <cflog text="UserGateway.cfc line 41 says key=#key#" />

    </cffunction>



outputs this to the console:
18/03/11 18:35.12: Information; CrowdVote;
Thread[1749987143@qtp-948074856-13,5,main]; UserGateway.cfc line 29 says
user.getId()=763461AE-A80B-4E01-879447F19C53FFBB
18/03/11 18:35.12: Information; CrowdVote;
Thread[1749987143@qtp-948074856-13,5,main]; UserGateway.cfc line 36 says
result=YES
18/03/11 18:35.12: Information; CrowdVote;
Thread[1749987143@qtp-948074856-13,5,main]; UserGateway.cfc line 41 says
key=agxjcm93ZHZvdGVnYWVyCgsSBHVzZXIYWgw


Note how user.getId() has length, I call googleDelete() on it before calling
googleWrite().

And even though the result is "YES", the user was not actually deleted,
which means every time this user is saved, I just get more copies of the
user.  I can follow along in the datastore viewer.

Probably missing something very simple but it's be haunting me for a few
days now (at roughly 20 minutes per day :)

Thanks.

-Jason

-- 
official tag/function reference: http://openbd.org/manual/
 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to