ORMEvictEntity()
Evicts all cached entries for the specified entity from the second-level cache.
ORMEvictEntity( entityName=String, primaryKey=String );
Returns: void
| Argument | Description |
|---|---|
|
entityName
String,
required
|
edit
Entity name |
|
primaryKey
String,
optional
|
edit
Primary key value of the component |
Usage Notes
editEvicts entity data from the second-level (L2) cache. Does not affect the first-level session cache — use ORMClearSession() for that.
If primaryKey is provided, only that specific instance is evicted. Otherwise all cached instances of the entity are evicted.
Only relevant when secondaryCacheEnabled is true in ORM - Configuration.
See ORM - Caching for L2 cache details.
Examples
edit// Evict all cached Product instances
ORMEvictEntity( "Product" );
// Evict a specific instance
ORMEvictEntity( "Product", "abc-123" );
See also
- ORM
- ORM - Caching
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)