Ticket #846 (closed defect: fixed)

Opened 12 months ago

Last modified 11 months ago

Over-optimization in codegen for cache key creation

Reported by: olegabr Owned by: somebody
Priority: important Milestone: 2.1.1
Component: Codegen Version: 2.1.0 Stable
Keywords: codegen, cache Cc:

Description

Over-optimization in codegen for cache key creation

The database name is written in generated ORM classes, makes changing it in configuration.inc.php senseless.

The patch attached to fix it back to the config-changable solution.

Attachments

class_load_and_count_methods.patch Download (1.2 KB) - added by olegabr 12 months ago.
patch for includes/qcubed/_core/codegen/templates/db_orm/class_gen/class_load_and_count_methods.tpl.php
object_delete.patch Download (1.1 KB) - added by olegabr 12 months ago.
patch for includes/qcubed/_core/codegen/templates/db_orm/class_gen/object_delete.tpl.php

Change History

Changed 12 months ago by olegabr

patch for includes/qcubed/_core/codegen/templates/db_orm/class_gen/class_load_and_count_methods.tpl.php

Changed 12 months ago by olegabr

patch for includes/qcubed/_core/codegen/templates/db_orm/class_gen/object_delete.tpl.php

Changed 12 months ago by vaibhav

This might sound really stupid but I do not know how to committ it properly (and I do not want to mess up). Do I get any web-UI for this within trac or has this to be done via my IDE? :| I do not have a test setup right now on system (thanks to the huge bloat PhpStorm is, I can't actually test it well enough within the time limit and the IDE is too awesome to leave!).

Someone more experienced who could tell me?

Changed 12 months ago by vaibhav

I see only one possible use of this change: it allows you to rename the database using the DBMS tool, then change the name in configuration.inc.php and get going. But changind a database name is too trivial a task that it be made dynamic.

Moreover, all cache keys will have the class name as a part of the key and that automatically makes the cache entries unique (simply because you cannot have two classes by the same name)! As such this patch does not give any huge advantage over the current system!

Changed 11 months ago by vakopian

  • status changed from new to in_QA

vaibhav, I agree that the cache would have to be cleaned when you change the db name, but at least you won't need to do an extra codegen. I'll commit the patch.

Changed 11 months ago by vakopian

  • status changed from in_QA to closed
  • resolution set to fixed

(In [1493]) fixes #846

Note: See TracTickets for help on using tickets.