-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC problem with TransactionalEventStore and ArangoDB #221
Comments
Can't we handle the logic behind the $arangoDbES->beginTransaction();
//$this->inTransaction = true;
$arangoDbES->create($stream);
//$this->transactionOperations[] = new ArangoCreateStreamOperation($stream);
$arangoDbES->appendTo($streamName, $streamEvents);
//$this->transactionOperations[] = new ArangoAppendToStreamOperation($streamName, $streamEvents);
$arangoDbES->commit();
//$this->executeTransaction();
//foreach($this->transactionOperations as $op) {/*map to transaction description*/}
//$this->arangoConnection->transaction($transactionDescription);
//or in case of a userland error before $arangoDbES->commit() is called
try {
//do something that causes an error
} catch (\Throwable $error) {
if ($arangoDbES->isInTransaction()) { //return $this->inTransaction;
$arangoDbES->rollback();
//$this->transactionOperations = [];
//$this->inTransaction = false;
}
} |
Yes that should be possible. It's only confusing if you have to use these methods and read in the ArangoDB docs, transaction is handled in one go. |
@sandrokeil can we close this now? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see some problems with
TransactionalEventStore
interface and ArangoDB or other event store implementations who handles transactions in another way. ArangoDB has nobeginTransaction
,commit
,rollback
orisInTransaction
see docs.Can we achieve more interoperability by simply using a function e.g.
executeTransaction
which gets a list of streams? But we have to differ betweencreate
andappendTo
. Maybe instead of usingcreate
andappendTo
methods, we introduce a stream type which can becreate
orappendTo
, so the provided stream list can be executed in order./cc @prolic @codeliner
The text was updated successfully, but these errors were encountered: