Cdbcriteria As Cache Dependency

When we define the cache dependency with CDbCacheDependency, we have to provide a SQL as the dependency. When we are using CDbCriteria, its not possible to provide the sql, as the sql is built via critera with proper paramters token.

Is there any way we can use the CDbCriteria as the cache dependency ? Is it right to ask such thing ? as I’m only interested in the sql being built by the CDbCriteria.

Thank you

A guy at stackoverflow has suggested me following code which requires a version upgrade of framework to 1.1.13

You can read on stackoverflow here