8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 19:23:03 +01:00

Let DSQL cache lock logic in SS too - per Dmitry request

This commit is contained in:
asfernandes 2008-03-03 15:40:56 +00:00
parent 68476041f0
commit e88fd596d9
6 changed files with 3 additions and 21 deletions

View File

@ -386,10 +386,8 @@ void DDL_execute(dsql_req* request)
break;
}
#ifndef SUPERSERVER
if (string)
MET_dsql_cache_release(tdbb, sym_type, string->str_data);
#endif // SUPERSERVER
JRD_ddl(tdbb, request->req_dbb->dbb_attachment, request->req_transaction,
request->req_blr_data.getCount(), (const SCHAR*) request->req_blr_data.begin());

View File

@ -1994,9 +1994,7 @@ static void insert_symbol(dsql_dbb* dbb, dsql_sym* symbol)
HSHD_insert(symbol);
#ifndef SUPERSERVER
MET_dsql_cache_use(tdbb, symbol->sym_type, symbol->sym_string);
#endif // SUPERSERVER
}
@ -2059,7 +2057,6 @@ static dsql_sym* lookup_symbol(dsql_dbb* dbb, USHORT length, const char* name, S
}
}
#ifndef SUPERSERVER
if (symbol)
{
bool obsolete = MET_dsql_cache_use(tdbb, type, name);
@ -2091,7 +2088,6 @@ static dsql_sym* lookup_symbol(dsql_dbb* dbb, USHORT length, const char* name, S
symbol = NULL;
}
}
#endif // SUPERSERVER
return symbol;
}

View File

@ -5160,10 +5160,8 @@ Attachment::Attachment(Database* dbb) :
att_context_vars(*dbb->dbb_permanent),
att_network_protocol(*dbb->dbb_permanent),
att_remote_address(*dbb->dbb_permanent),
att_remote_process(*dbb->dbb_permanent)
#ifndef SUPERSERVER
, att_dsql_cache(*dbb->dbb_permanent)
#endif
att_remote_process(*dbb->dbb_permanent),
att_dsql_cache(*dbb->dbb_permanent)
{
}

View File

@ -241,14 +241,12 @@ const int VAL_INDEX_CYCLE = 25;
const int VAL_MAX_ERROR = 26;
#ifndef SUPERSERVER
struct DSqlCacheItem
{
Lock* lock;
bool locked;
bool obsolete;
};
#endif
//
@ -322,9 +320,9 @@ public:
RandomGenerator att_random_generator; // Random bytes generator
#ifndef SUPERSERVER
Lock* att_temp_pg_lock; // temporary pagespace ID lock
#endif
Firebird::GenericMap<Firebird::Pair<Firebird::Left<
Firebird::string, DSqlCacheItem> > > att_dsql_cache; // DSQL cache locks
#endif
dsql_dbb* att_dsql_instance;
bool locksmith() const;

View File

@ -114,10 +114,8 @@ DATABASE DB = FILENAME "ODS.RDB";
using namespace Jrd;
#ifndef SUPERSERVER
static int blocking_ast_dsql_cache(void* ast_object);
static DSqlCacheItem* get_dsql_cache_item(thread_db* tdbb, int type, const Firebird::MetaName& name);
#endif
static int blocking_ast_procedure(void*);
static int blocking_ast_relation(void*);
static int partners_ast_relation(void*);
@ -1089,7 +1087,6 @@ void MET_delete_shadow( thread_db* tdbb, USHORT shadow_number)
}
#ifndef SUPERSERVER
bool MET_dsql_cache_use(thread_db* tdbb, int type, const Firebird::MetaName& name)
{
DSqlCacheItem* item = get_dsql_cache_item(tdbb, type, name);
@ -1122,7 +1119,6 @@ void MET_dsql_cache_release(thread_db* tdbb, int type, const Firebird::MetaName&
item->obsolete = false;
}
#endif
void MET_error(const TEXT* string, ...)
@ -4207,7 +4203,6 @@ void MET_update_transaction( thread_db* tdbb, jrd_tra* transaction, const bool d
}
#ifndef SUPERSERVER
static int blocking_ast_dsql_cache(void* ast_object)
{
/**************************************
@ -4269,7 +4264,6 @@ static DSqlCacheItem* get_dsql_cache_item(thread_db* tdbb, int type, const Fireb
return item;
}
#endif
static int blocking_ast_procedure(void* ast_object)

View File

@ -67,10 +67,8 @@ Jrd::DeferredWork* MET_change_fields(Jrd::thread_db*, Jrd::jrd_tra*, const dsc*)
Jrd::Format* MET_current(Jrd::thread_db*, Jrd::jrd_rel*);
void MET_delete_dependencies(Jrd::thread_db*, const Firebird::MetaName&, int);
void MET_delete_shadow(Jrd::thread_db*, USHORT);
#ifndef SUPERSERVER
bool MET_dsql_cache_use(Jrd::thread_db* tdbb, int type, const Firebird::MetaName& name);
void MET_dsql_cache_release(Jrd::thread_db* tdbb, int type, const Firebird::MetaName& name);
#endif
void MET_error(const TEXT*, ...);
Jrd::Format* MET_format(Jrd::thread_db*, Jrd::jrd_rel*, USHORT);
bool MET_get_char_coll_subtype(Jrd::thread_db*, USHORT*, const UCHAR*, USHORT);