Deletion forbidden, record is used by another one.

Deletion forbidden, record is used by another one.

book

Article ID: KB0073986

calendar_today

Updated On:

Products Versions
TIBCO EBX All supported versions.

Description

When trying to delete a record, the following error may pop up in the message box:

 User-added image 

The procedure is cancelled and we can see the following exception in the kernel log:

 <entry request="Procedure" branch="Reference" date="2020-12-11T13:13:11.147" entryId="6A9982D0-FD70-11E8-B3D2-00828FC9E762"> <sourceWebUser login="Uadmin" ipAddress="0:0:0:0:0:0:0:1" sessionId="B2404FB7687C2637B7B9618FACD7715D:0" /> <Procedure javaClass="com.orchestranetworks.manager.core.context.DeleteOccurrenceProcedure" executionInfo="Deleted record [./id=1234]" /> <failure javaClass="com.onwbp.adaptation.UowWrapperError" message="ConstraintViolationException[/root/table[./id=1234]: Data model node: /root/table. Deletion forbidden, record 'aaa' is used by another one.]" />  <failureCause javaClass="com.orchestranetworks.schema.ConstraintViolationException" message="Data model node: /root/table. Deletion forbidden, record 'aaa' is used by another one." /> </entry>

Issue/Introduction

Deletion forbidden, record is used by another one.

Resolution

The error appears because the record we are trying to delete is referenced by another record which foreign key is in blocking mode.
You can modify the foreign key control policy in Advanced controls -> Message -> Error management policy:

User-added image

Please note that foreign key constraints that are automatically set in blocking mode are:
  • Foreign key constraints that are defined on a table in relational mode,

  • Foreign key constraints that are defined on a table in semantic or relational mode referencing a table in relational mode.

Additional Information

https://docs.tibco.com/pub/ebx/5.9.12/doc/html/en/references/relationalMode.html#blockingModeTableRef