# clear

fun clear(flush: Boolean = true)

Clears this EntityCache of all stored data, including any reference mappings.

#### Parameters

flush

By default, pending inserts and updates for all cached entities will first be sent to the database. If this is set to `false`, any pending operations will not be flushed and will be removed as well.

#### Samples

org.jetbrains.exposed.sql.tests.shared.entities.EntityCacheTests.changeEntityCacheMaxEntitiesToStoreInMiddleOfTransaction