The table must be the same in the context of a transaction

The table must be the same in the context of a transaction

book

Article ID: KB0074626

calendar_today

Updated On:

Products Versions
TIBCO EBX All supported versions.

Description

When EBX executes a procedure, the following exception may be thrown:

java.lang.IllegalStateException: The table must be the same in the context of a transaction:CfTableCache[/root/FinAcctNode in data set myDataset in data space MasterDataSpace]@26be927c; CfTableArray[id:746, tableRid:261, parentId:0]@3edc572c; CfTableArray[id:746, tableRid:261, parentId:0]@73df29f1

Issue/Introduction

The table must be the same in the context of a transaction

Resolution

This error generally appears when:
  • An OperationException is thrown inside the procedure
  • The exception is caught using a catch block
  • Updates are performed inside the catch block using the ProcedureContext
When an exception is thrown during a procedure execution, the procedure is canceled and its execution is stopped, to ensure the transactional aspect of procedures.
It is not supported to continue using the ProcedureContext in a catch block after an exception has been thrown during the procedure execution.

In general, when exceptions are catched, they should be always raised in the stack:

try{ 
procedureContext.doCreateOccurrence(valueContextForCreate, myTable); 
}
catch (OperationException ex)
{ 
throw new RuntimeException(ex); 
}