Skip to content

Instantly share code, notes, and snippets.

@owenallenaz
Created September 5, 2012 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owenallenaz/3628639 to your computer and use it in GitHub Desktop.
Save owenallenaz/3628639 to your computer and use it in GitHub Desktop.
Throw this in a folder and execute index.cfm and you'll see a multiple datasource error, even though only one datasource is used inside the cftransaction.
<cfcomponent>
<cfset this.name = "mySpecialApp">
<cfset this.datasource = "rc_cms">
<cfset this.ormEnabled = true>
<cffunction name="onError">
<cfdump var="#arguments#">
</cffunction>
</cfcomponent>
<cfcomponent persistent="true" table="supportedLanguages" cacheuse="transactional">
<!--- standard fields --->
<cfproperty name="languageid" fieldtype="id" generator="identity">
<cfproperty name="code" notnull="true">
<cfproperty name="label" notnull="true">
<cfproperty name="active" type="boolean" default="true" dbdefault="1" notnull="true">
</cfcomponent>
<!--- If you comment out this line you do not get the error --->
<cfset EntityLoad("googleTranslateLanguagesOrm")>
<cftransaction>
<cftry>
<cfquery name="local.qry" datasource="imagecdn">
SELECT count(*) FROM jobs
</cfquery>
<cfcatch>
<cftransaction action="rollback"/>
</cfcatch>
</cftry>
</cftransaction>
<!--- call this file to reset the app while testing (if need be) --->
<cfset ApplicationStop()>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment