Re: triggers and locks

From: Lawrence James <James.Lawrence_at_epamail.epa.gov>
Date: Thu, 10 Nov 1994 22:38:51 GMT
Message-ID: <James.Lawrence.5.0011A649_at_epamail.epa.gov>


In article <392a5n$3n6_at_nuscc.nus.sg> fbap3120_at_cobra.nus.sg (Virinchipuram J. A.) writes:
>From: fbap3120_at_cobra.nus.sg (Virinchipuram J. A.)
>Subject: triggers and locks
>Date: 31 Oct 1994 08:33:59 GMT
 

>Hi Gurus!
>
> I will first give u a overview and then present my query:
>
> I have four tables: company_p, employee_p, dependent_p and patient.
>
> Table_name Key Referential integrity
> ______________________________________________________________
> company_p comp_code none
> employee_p emp_num comp_code (on Cascade Delete)
> dependent_p emp_num, depn_num emp_num (on Cascade Delete)
> patient pateint_id none
 

> I have following triggers
 

> Table_name Trigger_name Tirgger_type Action
> _______________________________________________________________
> employee_p up_patient1 After Delete Update a column
> in patient
> table, and
> Insert the
> deleted record
> from the
> employee_p
> table
> into an
> exclusion table
>
>
> dependent_p up_patient2 After Delete update a column
> in patient
> table.
> Insert the
> deleted
> record
> from the
> dependnt_p
> table
> into an
> exclusion
> table.
>
> company_p trigger_3 After Delete Insert
> the deleted
> record
> into an
> exclusion
> table.
 

> The thing that I want to accomplish is this:
> When I delete a company record, by referential constraint
> I am able to cascade delete the employee records and the dependent
> records and at the same time through the triggers, I am able to
> update and insert records in appropriate tables.
 

> The situation I faced, was that the system crashed, when I deleted
> a record from the company_p table, complaining that the DML locks
> were exceeded.
 

> My query is why is it that it complained, and whether this can be
> rectified by increasing the number of locks in the initialilization
> file.
>

Why don't you increase it and see.

I think the correct answer is that if you want to retain occurences of an entity you shoul continue to do it in that entity. IE don't move the row to another table, change it's status. It will consume considerably less computer.

>-anand
 

>--
>Anand. V. J Internet:fbap3120_at_leonis.nus.sg
>Dept Of Decision Sciences
>National University Of Singapore
Received on Thu Nov 10 1994 - 23:38:51 CET

Original text of this message