This discussion is archived
3 Replies Latest reply: Jun 23, 2011 2:25 PM by Mark Striekwold RSS

Del action not Inserted in JN-Tab. when upd and del on same rec in transact

835402 Newbie
Currently Being Moderated
Hello,

When I perform an update and a delete on the same record within the same headstart-transaction I don't see records for the update and delete in the belonging journal table. I think this is a bug in the headstart software.
I'm using the following version of qms_transaction_mgt:
exec dbms_output.put_line(qms_transaction_mgt.revision)
6.5.3.8

script example where problem occurs:
begin
qms_transaction_mgt.open_transaction('trans1');
update A set <column 1>=<value> where <primary key>=1;
delete A where <primary key>=1;
qms_transaction_mgt.close_transaction('trans1');
commit;
end;
/

Let's say the belonging journal table is A_JN. After executing a script like above nothing has been registrated in A_JN.

Does someone know how to solve this problem?

Thanks in advance
  • 1. Re: Del action not Inserted in JN-Tab. when upd and del on same rec in transact
    Mark Striekwold Journeyer
    Currently Being Moderated
    Did you also recreate the capi and tapi belonging to the table? There should be some code inside the tapi or capi which puts the records inside the journal table.
  • 2. Re: Del action not Inserted in JN-Tab. when upd and del on same rec in transact
    835402 Newbie
    Currently Being Moderated
    Yes I did recreate the tapi and capi. It's only going wrong for the combination of an update and a delete action on the same record within a transaction. If I only delete a record within a transaction the headstart code is working fine, then I see a "DEL" record in the journal table. This is also the case for insert and update actions.

    Maybe the problem has something to do with the procedure perform_business_rule in qms_transaction_mgt. When performing business-rules headstart keeps track of records that are deleted during transaction. This is a comment in the procedure:
    -- 6.5.3.4 Do NOT perform the business rule when the key is present in g_del_stack
    -- (this is a stack with rules that can be omitted: it concerns deleted rows)
    Perhaps a side effect of this mechanism is this problem I encounter. The reason for this, I noticed that the capi code that performs the writing to the journal table is treated as a business-rule by headstart. I became aware of this when I executed capi procedure disable_all_br. First I expected that the journalling code in the capi would not be effected by this procedure, but to my surprise it was. That's the reason I suspect the g_del_stack mechanism for not performing the journalling code in the capi trigger.

    Does this ring a bell? And do you know how to solve this?
  • 3. Re: Del action not Inserted in JN-Tab. when upd and del on same rec in transact
    Mark Striekwold Journeyer
    Currently Being Moderated
    This doesn't ring a bell and I have no solution.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points