Ask a Question related to Coldfusion Database Access, Design and Development.
-
nk151 #1
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
-
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... -
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... -
Coldfusion 5.0 cachedwithin & cfqueryparam
Running Coldfusion Enterprise Server 5.0, our staging environment is allowing the following type query: <cfquery name="rsCategories"... -
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... -
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... -
BKBK #2
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



Reply With Quote

