Skip to main content
Participating Frequently
December 22, 2011
Question

Help with cfapplication - datasource

  • December 22, 2011
  • 2 replies
  • 1251 views

According to http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d69.html

I should be able to use datasource="" in the cfapplication tag.

When I do, I get the error:

Attribute validation error for tag CFAPPLICATION.

It does not allow the attribute(s) DATASOURCE. The valid attribute(s) are APPLICATIONTIMEOUT,CLIENTMANAGEMENT,CLIENTSTORAGE,LOGINSTORAGE,NAME,SCRIPTPROTECT,SECUREJSON,SECUREJSONPREFIX,SERVERSIDEFORMVALIDATION,SESSIONMANAGEMENT,SESSIONTIMEOUT,SETCLIENTCOOKIES,SETDOMAINCOOKIES.

I just want to take advantage of the Coldfusion 9 feature so I don't have to include the datasource attribute for every cfquery tag.

I get the error on both my local machine and the server. Both have Coldfusion 9.

Thanks

    This topic has been closed for replies.

    2 replies

    Inspiring
    December 22, 2011

    Hmmm.  Works fine for me on CF 9.0.1 (you're just on 9.0, I note...).

    --

    Adam

    Community Expert
    December 22, 2011

    Do your machines also have another version of CF installed? What do you get when you CFDUMP the server scope?

    Dave Watts, CTO, Fig Leaf Software

    Dave Watts, Eidolon LLC
    Participating Frequently
    December 22, 2011

    If I have this for my application.cfm:

    <CFApplication NAME="sermons" SESSIONMANAGEMENT="YES" clientmanagement="yes">

    <CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="5">

         <CFCOOKIE NAME="CFID" VALUE="#SESSION.CFID#">

         <CFCOOKIE NAME="CFTOKEN" VALUE="#SESSION.CFTOKEN#">

    </CFLOCK>

    <cfheader name="P3P:CP" value="CAO PSA OUR">

    cfdump shows this:

    struct
    coldfusion
    struct
    InstallKitNative Windows
    appserverJRun4
    expiration{ts '2010-04-11 21:32:31'}
    productlevelDeveloper
    productnameColdFusion Server
    productversion9,0,0,251028
    rootdirD:\ColdFusion9
    supportedlocalesChinese (China),Chinese (Hong Kong),Chinese (Taiwan),Dutch (Belgian),Dutch (Standard),English (Australian),English (Canadian),English (New Zealand),English (UK),English (US),French (Belgian),French (Canadian),French (Standard),French (Swiss),German (Austrian),German (Standard),German (Swiss),Italian (Standard),Italian (Swiss),Japanese,Korean,Norwegian (Bokmal),Norwegian (Nynorsk),Portuguese (Brazilian),Portuguese (Standard),Spanish (Mexican),Spanish (Modern),Spanish (Standard),Swedish,ar,ar_AE,ar_BH,ar_DZ,ar_EG,ar_IQ,ar_JO,ar_KW,ar_LB,ar_LY,ar_MA,ar_OM,ar_QA,ar_SA,ar_SD,ar_SY,ar_TN,ar_YE,be,be_BY,bg,bg_BG,ca,ca_ES,cs,cs_CZ,da,da_DK,de,de_AT,de_CH,de_DE,de_LU,el,el_CY,el_GR,en,en_AU,en_CA,en_GB,en_IE,en_IN,en_MT,en_NZ,en_PH,en_SG,en_US,en_ZA,es,es_AR,es_BO,es_CL,es_CO,es_CR,es_DO,es_EC,es_ES,es_GT,es_HN,es_MX,es_NI,es_PA,es_PE,es_PR,es_PY,es_SV,es_US,es_UY,es_VE,et,et_EE,fi,fi_FI,fr,fr_BE,fr_CA,fr_CH,fr_FR,fr_LU,ga,ga_IE,hi_IN,hr,hr_HR,hu,hu_HU,in,in_ID,is,is_IS,it,it_CH,it_IT,iw,iw_IL,ja,ja_JP,ja_JP_JP,ko,ko_KR,lt,lt_LT,lv,lv_LV,mk,mk_MK,ms,ms_MY,mt,mt_MT,nl,nl_BE,nl_NL,no,no_NO,no_NO_NY,pl,pl_PL,pt,pt_BR,pt_PT,ro,ro_RO,ru,ru_RU,sk,sk_SK,sl,sl_SI,sq,sq_AL,sr,sr_BA,sr_CS,sr_ME,sr_RS,sv,sv_SE,th,th_TH,th_TH_TH,tr,tr_TR,uk,uk_UA,vi,vi_VN,zh,zh_CN,zh_HK,zh_SG,zh_TW
    os
    struct
    additionalinformation[empty string]
    archamd64
    buildnumber[empty string]
    nameWindows 7
    version6.1

    If I change it to:

    <CFApplication NAME="sermons" datasource="sermons" SESSIONMANAGEMENT="YES" clientmanagement="yes">

    <CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="5">

         <CFCOOKIE NAME="CFID" VALUE="#SESSION.CFID#">

         <CFCOOKIE NAME="CFTOKEN" VALUE="#SESSION.CFTOKEN#">

    </CFLOCK>

    <cfheader name="P3P:CP" value="CAO PSA OUR">

    I get this for my dump:

    Attribute validation error for tag CFAPPLICATION.

    It does not allow the attribute(s) DATASOURCE. The valid attribute(s) are APPLICATIONTIMEOUT,CLIENTMANAGEMENT,CLIENTSTORAGE,LOGINSTORAGE,NAME,SCRIPTPROTECT,SECUREJSON,SECUREJSONPREFIX,SERVERSIDEFORMVALIDATION,SESSIONMANAGEMENT,SESSIONTIMEOUT,SETCLIENTCOOKIES,SETDOMAINCOOKIES.

    The error occurred in D:\inetpub\wwwroot\Sermons\Application.cfm: line 1
    1 : <CFApplication NAME="sermons" datasource="sermons" SESSIONMANAGEMENT="YES" clientmanagement="yes"> 2 : 3 : <CFLOCK SCOPE="SESSION" TYPE="READONLY" TIMEOUT="5">