cachedwithin java error after upgrade to 7.02

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default cachedwithin java error after upgrade to 7.02

    We've just upgraded a server from 7 to 7.02, and have identified that queries
    now throw an error when cachedwithin is included in the query tag. However, it
    only happens when the statement is an insert. Before the upgrade it worked
    fine, it doesn't after.

    It's not a major problem, but we use <cfquery> tag wrapped up in a custom
    template to do all sorts of other database management stuff (auditing,
    security, type checking, etc.).

    The attached code demonstrates it. On the 7.00 version, the query runs fine.
    On 7.02 we get the following message:

    "Error casting an object of type to an incompatible type. This usually
    indicates a programming error in Java, although it could also mean you have
    tried to use a foreign object in a different way than it was designed. "

    Any thoughts greatly appreciated. TIA.

    Neville Kilford

    <cfquery datasource="somedatasourceorother"
    cachedwithin="#createtimespan(0,0,0,0)#">
    update sometable
    set somefield = somefield
    </cfquery>

    nk151 Guest

  2. Similar Questions and Discussions

    1. Java Upgrade
      I used the knowledgebase 2d547983 to upgrade the JVM and it worked fine. However I had several certificates imported to the old Java key-store used...
    2. Database Error after Upgrade to MX7
      After upgrading from MX 6.1 to MX 7, and installing the comprehensive patch, I get the following error when trying to access a SQL database. This...
    3. Coldfusion 5.0 cachedwithin & cfqueryparam
      Running Coldfusion Enterprise Server 5.0, our staging environment is allowing the following type query: <cfquery name="rsCategories"...
    4. upgrade Sql error
      I had coldfusion 5 application running and when I deploy the same on cold fusion MX 7.0 the Queries had a problem of SQLSTATE 42601 and the...
    5. Java Script error (error 3) when trying to access Commands
      Hello folks: I have been a long time lurker/reader of this forum. As of yesterday, out of nowhere, when accessing 'Commands' from the top level...
  3. #2

    Default Re: cachedwithin java error after upgrade to 7.02

    First, what one usually wants to cache is the resultset of a query. That is,
    the result of a select-query. I see no motivation for caching an update-query
    or an insert-query. What then should Coldfusion then store in memory? To see
    why there could be problems when you instruct Coldfusion to cache
    update-queries and insert-queries, run the following test

    <cfquery name="q1" datasource="myDataSource">
    insert into testtable (column1,column2)
    values ('value1','value2')
    </cfquery>
    <p>Is insert-query name defined:
    <cfoutput>#isDefined("q1")#</cfoutput></p>

    <cfquery name="q2" datasource="myDataSource">
    update testtable
    set column1 = 'value3'
    where column2 = 'value2'
    </cfquery>
    <p>Is update-query name defined:
    <cfoutput>#isDefined("q2")#</cfoutput></p>

    <cfquery name="q3" datasource="myDataSource">
    select * from testtable
    </cfquery>
    <p>Is select-query name defined:
    <cfoutput>#isDefined("q3")#</cfoutput></p>
    <cfdump var="#q3#">

    Second, if you want to cache a (select) query, then cache it using using a
    non-zero time span. Otherwise, don't use the cachedWithin attribute at all.
    The attribute value cachedwithin="0" is ambiguous and should be avoided.



    BKBK Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139