Hi Mark,
Yes thanks - that seems to be better.
I think I've got my head around it now, but then I got the following
exception
Data source ds_web_content verification failed.
The root cause was that: java.sql.SQLException: Usernames and
Passwords for all the database tags within CFTRANSACTION must be the
same.
My transfer Datasource.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<datasource>
<name>ds_web_content</name>
<username></username>
<password></password>
</datasource>
The <cfquery> tag in my legacy code is as follows:
<cfquery name="qUpdateCmsPage" datasource="ds_web_content">
...
</cfquery>
Changing it to
<cfquery name="qUpdateCmsPage" datasource="ds_web_content" username=""
password="">
seemed to work *shrugs*
Andrew.
On Oct 13, 1:08 pm, "Mark Mandel" <[EMAIL PROTECTED]> wrote:
> I would advise having a good read of them, as they are pretty much *
> the * way to do transactions with Transfer.
>
> But to answer your question directly, no, you don't use <cftransaction>.
>
> By doing a <cfset arguments.transaction.advise(this, "^save") />, the
> Transaction service goes looking in your CFC for any methods that
> matches that regex (in this case '^save').
>
> If it finds them, it automagically wraps that method inside a Transfer
> Transaction (which handles bother DB and cache rollback), without you
> having to change any of your existing code.
>
> That make more sense?
>
> Mark
>
>
>
> On Mon, Oct 13, 2008 at 12:59 PM, Andrew <[EMAIL PROTECTED]> wrote:
>
> > Hi Mark,
>
> > I did have a quick look at those docs but the examples confused me
> > because none of them have a <cftransaction></cftransaction> block in
> > them.
>
> > If I do as suggested and put this kind of thing in my init method:
>
> > <cfset arguments.transaction.advise(this, "^save") />
>
> > Do I still use the <cftransaction> tags:
>
> > <cftransaction>
>
> > <cfscript>
> > newPage =
> > variables.instance.transfer.new("Admin.CmsPageContent");
>
> > newPage.setPage_content_text(arguments.pageText);
> > newPage.setPage_title(arguments.pageTitle);
> > newPage.setPage_header(arguments.pageHeader);
> > newPage.setCms_page_key(arguments.pageKey);
> > newPage.setEditor_id(arguments.editorId);
> > variables.instance.transfer.save(newPage);
> > </cfscript>
>
> > <cfset theInsertedId = newPage.getPage_content_id>
>
> > <!--- Now update cms_page to set the new value --->
> > <cfquery name="qUpdateCmsPage"
> > datasource="ds_web_content">
> > update cms_page
> > set key_num_draft = <cfqueryparam
> > cfsqltype="cf_sql_integer"
> > value="#theInsertedId#">
> > where key_num = <cfqueryparam
> > cfsqltype="cf_sql_integer"
> > value="#arguments.pageKey#">
> > </cfif>
> > </cfquery>
>
> > </cftransaction>
>
> > Or is the whole method implicitly wrapped in a transaction?
>
> > Andrew.
>
> --
> E: [EMAIL PROTECTED]
> W:www.compoundtheory.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---