Closed (fixed)
Project:
Entity cache
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2011 at 20:05 UTC
Updated:
10 Nov 2014 at 20:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
fagoI'm not keen on having the bin tables auto-created even if there is no entitycache module available. Maybe, we can enable support for that only if another cache bin is configured? Or we could make a hidden conf variable for that?
I guess most people are going to use other cache backends anyway.
Comment #2
jhedstromGiven the drastic performance improvements that EntityCache offers, even on the normal cache backend, I think it would be beneficial for the Entity API module to make integration with that as simple as possible.
Given that such popular projects as Commerce and Field Collection require Entity API, I don't think it's safe to assume the standard use-case will involve alternative cache backends. However, even if that were the case, having Entity API control EntityCache integration would make life that much simpler for both users of the default cache, and the alternative cache backends.
It's possible that this change might make more sense going into the EntityCache module itself.
Comment #3
fago>It's possible that this change might make more sense going into the EntityCache module itself.
I like that idea. It would be great if the EntityCache module could care about creating the cache bins, or maybe just go with an "entitycache" cache bin by default and making using custom bins optional.
Once we've that working I think it's not up to the entity.api module any more to enable entitycache by default, but users could just do
.
Thus, moving over to entitycache.
Comment #4
fago(double post)
Comment #5
catchI would like entitycache to create bins automatically, however it's probably not going to happen for this reason:
Creating bins is probably fine - do a db_table_exists() check in hook_modules_installed() and check entity_get_info() for new modules.
Removing bins won't work - when a module is uninstalled, hook_entity_info() won't return information about the entity type being removed, so we can't remove the bin.
If someone can come up with a relatively simple workaround for this that'd be great, but otherwise I'm not keen.
See also #1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed.
Comment #6
jhedstromWould something like a simple variable that tracks which entity types have had bins created for them be a sufficient workaround?
Comment #7
webflo commentedRelated issue in Countries issue queue. I have created a new module for entity cache integration. see #1397762: Entity cache integration
Comment #8
tstoecklerAlso hit this for profile2. I posted a patch over there against Entity API. It suffers from the problem catch denotes in #5, I didn't think of that (it's untested so far).
Here's a patch, which builds on that and simply tracks the tables to drop in a variable. Not the most beatiful solution, obviously, but it works. We're simply missing a hook_modules_pre_uninstalled() or something.
Not setting to needs review, as this is against entity module.
Comment #9
steven jones commentedSo I posted patches against ECK and Field collection to add entity cache support and we've done it by implementing a simple boilerplate module that just depends on both Entitycache and the module providing the entity, which just seems like a neat way to sidestep this whole issue.
#1268620: Use Entity Cache in Field Collection
#1506468: EntityCache support
Comment #10
tstoecklerCreated #2017685: Automatically create cache tables for entities that want to support entitycache.module in the Entity API queue.
Comment #11
dasjosee fago's follow up in the entity api queue: #2017685-2: Automatically create cache tables for entities that want to support entitycache.module
Comment #12
skwashd commentedThis was fixed in Entity API (see #2017685).
Comment #14
Fidelix commentedThanks!