diff --git a/src/jrd/met.epp b/src/jrd/met.epp index 53f7d6f592..24d656f239 100644 --- a/src/jrd/met.epp +++ b/src/jrd/met.epp @@ -4219,7 +4219,7 @@ static DSqlCacheItem* get_dsql_cache_item(thread_db* tdbb, int type, const Fireb { item->obsolete = false; item->locked = false; - item->lock = FB_NEW_RPT(*dbb->dbb_permanent, key.length()) Lock(); + item->lock = FB_NEW_RPT(*attachment->att_pool, key.length()) Lock(); item->lock->lck_type = LCK_dsql_cache; item->lock->lck_owner_handle = LCK_get_owner_handle(tdbb, item->lock->lck_type);