Subject | Re: Foreign-key integrety violation on delete |
---|---|
Author | paulbramble |
Post date | 2005-09-23T20:20:27Z |
Basically, it's the following series of deletes:
Delete from POLICY_ACTION where sys_id = 1 and POLICY_ID = 287;
Delete from CONDITIONAL_STATEMENT where sys_id = 1 and POLICY_ID =
287;
Delete from CONDITIONAL_OPERATOR where sys_id = 1 and POLICY_ID =
287;
Delete from POLICY_CONDITION where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_GROUP where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_RULE where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_SET_PARENT where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY where sys_id = 1 and POLICY_ID = 287;
Delete from EFFECTIVE_DATE where sys_id = 1 and POLICY_SET_ID = 287;
Delete from POLICY_SET where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_SET where sys_id = 1 and POLICY_SET_ID = 287;
Its on the last delete that I get the integrity violation, even
thought I've deleted everything.
I just discovered that the reason that the database is being changed
is that the upstream code catches and eats the resulting exception,
so it thinks that the operation was successful, and JBoss commits
the transaction.
Again, my question has to deal with the integrity violation.
THanks,
Paul
--- In Firebird-Java@yahoogroups.com, "paulbramble" <pdbramble@a...>
wrote:
Delete from POLICY_ACTION where sys_id = 1 and POLICY_ID = 287;
Delete from CONDITIONAL_STATEMENT where sys_id = 1 and POLICY_ID =
287;
Delete from CONDITIONAL_OPERATOR where sys_id = 1 and POLICY_ID =
287;
Delete from POLICY_CONDITION where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_GROUP where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_RULE where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_SET_PARENT where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY where sys_id = 1 and POLICY_ID = 287;
Delete from EFFECTIVE_DATE where sys_id = 1 and POLICY_SET_ID = 287;
Delete from POLICY_SET where sys_id = 1 and POLICY_ID = 287;
Delete from POLICY_SET where sys_id = 1 and POLICY_SET_ID = 287;
Its on the last delete that I get the integrity violation, even
thought I've deleted everything.
I just discovered that the reason that the database is being changed
is that the upstream code catches and eats the resulting exception,
so it thinks that the operation was successful, and JBoss commits
the transaction.
Again, my question has to deal with the integrity violation.
THanks,
Paul
--- In Firebird-Java@yahoogroups.com, "paulbramble" <pdbramble@a...>
wrote:
> I am having an intermittant problem with deletes.the
>
> Our system runs under JBoss.
>
> I have a hierarchical structure of 11 tables. Because our product
> must run against multiple vendor's rdbms, I hard coded some of the
> deletes. I start deleting my tree from the bottom up. However,
> when I try to delete the topmost object, I get an error stating an
> integrety constraint on a foreign key is violated. (don't have
> error code of the violation).
>
> I am sure everything has been deleted under the top level object.
> There are only 10 possible tables in which sub-tending data can
> reside, and I can see that all 10 deletes have been executed. And
> the data is gone.
>
> Any ideas as to what is going on?
>
> Thanks,
> Paul