Subject | Re: [firebird-support] Re: Deadlock during index activation |
---|---|
Author | Alec Swan |
Post date | 2010-07-29T15:11:18Z |
Hi Vlad,
Thank you for the explanation. Our application has a maintenance plan which
calls ACTIVATE INDEX on every index in the database. It is possible that
other queries and statements are run against the database during the
maintenance plan. According to your explanation those concurrent
modifications may cause the "deadlock" error to be thrown during index
activation. Would you suggest preventing concurrent queries and
modifications during index activation?
Where can I get the full message for the "deadlock" error I am seeing? (What
I reported was the entire message I receive from Jaybird.)
Thanks,
Alec
Thank you for the explanation. Our application has a maintenance plan which
calls ACTIVATE INDEX on every index in the database. It is possible that
other queries and statements are run against the database during the
maintenance plan. According to your explanation those concurrent
modifications may cause the "deadlock" error to be thrown during index
activation. Would you suggest preventing concurrent queries and
modifications during index activation?
Where can I get the full message for the "deadlock" error I am seeing? (What
I reported was the entire message I receive from Jaybird.)
Thanks,
Alec
On Tue, Jul 27, 2010 at 12:36 AM, hvlad <hvlad@...> wrote:
>
>
> --- In firebird-support@yahoogroups.com<firebird-support%40yahoogroups.com>,
> "Alec L" wrote:
> >
> > I forgot to mention that we are using Firebird 2.1.2 on Windows XP SP3 in
> Embedded mode. The statement that activates indexes is executed via the
> Jaybird JDBC driver 2.1.6.
> >
> > Does anybody have any thoughts on this?
> >
> > --- In firebird-support@yahoogroups.com<firebird-support%40yahoogroups.com>,
> Alec Swan wrote:
> > >
> > > Hello,
> > >
> > > Could anybody explain what could cause a deadlock during index
> > > activation on the entire database?
> > >
> > > EXECUTE BLOCK AS DECLARE VARIABLE stmt VARCHAR(1000); BEGIN for select
> > > 'ALTER INDEX "'||rdb$index_name ||'" ACTIVE;'
> > > from rdb$indices
> > > where rdb$system_flag is not null and rdb$system_flag = 0 into :stmt
> > > do EXECUTE STATEMENT :stmt; END;
> > >
> > > GDS Exception. 335544336. deadlock
> > > Reason: deadlock
>
> When Firebird creates index it takes PR (protected read) lock on table's
> metadata to prevent concurrent modifications of data (else index will be not
> consistent). If index is related to FK constraint then locks for both tables
> should be taken.
> If engine can't take lock it will return appropriate error.
> It seems you have not full error message but only primary error code.
>
> Regards,
> Vlad
>
>
>
[Non-text portions of this message have been removed]