After following this example on creating Compare Exchange Items, I have a workflow where I then need to delete it after the work is done.
To delete_compare_exchange_value I could do something like:
def remove_compare_exchange_item(self) -> None:
with self.document_store.open_session(
session_options=SessionOptions(
transaction_mode=TransactionMode.CLUSTER_WIDE
)
) as session:
current_lock: CompareExchangeValue[DocumentsCompareExchangeItem] | None = (
session.advanced.cluster_transaction.get_compare_exchange_value(
key=self.compare_exchange_key,
object_type=DocumentsCompareExchangeItem,
)
)
if current_lock is None:
logger.info(
"No compare exchange item found to remove",
key=self.compare_exchange_key,
)
return
session.advanced.cluster_transaction.delete_compare_exchange_value(
current_lock
)
session.save_changes()
Or a combination of:
session.advanced.cluster_transaction.delete_compare_exchange_value(
item_or_key=current_lock.key, index=current_lock.index
)
Lastly:
session.advanced.cluster_transaction.delete_compare_exchange_value(
item_or_key=current_lock, index=current_lock.index
)
However, no matter how I format the arguments to session.advanced.cluster_transaction.delete_compare_exchange_value(), the Compare Exchange Item is not removed from RavenDB Server. There are no errors thrown during this process.
Edit:
- This is using
ravendb client version 7.2.0
- This is using
ravendb server version 7.2.0
After following this example on creating
Compare Exchange Items, I have a workflow where I then need to delete it after the work is done.To
delete_compare_exchange_valueI could do something like:Or a combination of:
Lastly:
However, no matter how I format the arguments to
session.advanced.cluster_transaction.delete_compare_exchange_value(), theCompare Exchange Itemis not removed from RavenDB Server. There are no errors thrown during this process.Edit:
ravendbclient version 7.2.0ravendbserver version 7.2.0