You wouldn't try to inject the "transfer" object to handle transactions.
Transactions are handled by the "transferTransaction" object.

If you're using coldbox, you could wire the transferTransaction object like
below and then use it to advise your functions. Sample below is using
regular expressions to determine which functions gets advised.

<cffunction name="init" access="public" returntype="any" output="false"
hint="constructor">
     <cfargument name="TransferTransaction" type="Any"
_wireme="ocm:TransferTransaction">

     <!--- Make these functions run in a transaction --->
     <cfset arguments.TransferTransaction.advise(this,
"function1|function2") />

     <cfreturn this>
</cffunction>

- Gabriel


On Tue, Nov 3, 2009 at 11:31 AM, marc <[email protected]> wrote:

>
> That looks very good!
> I try to go for method #2:
>
> <cffunction name="init" hint="saves Foo, and its children"
> access="public" returntype="void" output="false">
>    <cfargument name="transaction" hint="The transaction object"
> type="transfer.com.sql.transaction.Transaction" required="Yes">
>
>    <cfset arguments.transaction.advise(this, add/>
> </cffunction>
>
> 'add' is the bunch of code below [... code ..]  in my 1st post.
>
> Anyway, I get an error
>
> The TRANSACTION parameter to the init function is required but was not
> passed in.
>
> makes sense, since I specify the argument and set it's required
> attribute to true. But I have no idea where do I call it from and how
> do I pass the parameter? I use Coldbox so I tried
> _wireme="ocm:transfer" parameter in the argument but that is not
> enough...
> The docs didn't mention that.
>
> Marc
> >
>

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to