Database Error Messages

OCI-05059

Cannot begin or commit a distributed transaction on a shard (phase = phase_name, transaction ID = transaction_id).
  • phase_name: The phase of the transaction at which point this error was detected.
  • transaction_id: The global transaction ID. The transaction ID prefix will identify the shard that began or promoted this distributed transaction.

Cause

Sharding Raft replication only supports distributed transactions that have been started on the sharding catalog. This rule allows for seamless failover and recovery of replicated distributed transactions. Your application has attempted to begin, promote or commit a distributed transaction from a shard. This transaction will not be committed. Updating a sharding key after executing ALTER TABLE ENABLE ROW MOVEMENT, and which moves the row to another shard, could start an internal distributed transaction on the shard. This type of update is not supported in sharding Raft replication.


Action

Execute your distributed transaction from the catalog. You could use an Oracle shard-aware connection pool (UCP) for data-dependent routing to the correct physical shard. After selecting data from a remote table using a database link, make sure to commit that transaction before updating a replicated table.