You must access your db somewhere. Like all other components the db component is only created when it is used. Maybe you configured CDbHttpSessions as session component? Or do you use RBAC and save your hierarchy in DB? Check the logs, to find out which queries are sent to the database.
One more thing to add to the Mike answer… could be that you have a dependency for the cache to check if the cache is still valid… so to evaluate this dependency, again a call to the database should be made…
I finally find out the root case, it’s because my data value is NULL,
for example i has a table:
My script in controller:
When i check trace info, still have db connection, but when the subject value is not null or change the subject is not allow null on the db table, it’s no db connection…