Feature/nex 519/add transactional - #104
Conversation
…avior between Rds- and SqsQueueBroker.
…) and gather all the transaction pattern in try-catch.
…See Doctrine\DBAL\Connection::transactional().
| use Doctrine\DBAL\Schema\SchemaException; | ||
| use Exception; | ||
| use InvalidArgumentException; | ||
| use Google\Cloud\Spanner\Transaction; |
There was a problem hiding this comment.
i think we should not do this, connection the Rds with the Cloud\Spanner is not the best option
There was a problem hiding this comment.
You're right, but this is only for the Spanner custom branch. Of course, this will be in an abstraction class for transaction, of course.
| $logContext = [ | ||
| 'QueueUrl' => $this->queueUrl | ||
| ]; | ||
| $logContext = ['QueueUrl' => $this->queueUrl]; |
There was a problem hiding this comment.
why are we touching this ?
SqsQueueBroker which is for using AWS SQS. -- and this will be a google cloud platform solution
There was a problem hiding this comment.
As stated in the commit, this was just to have an homogenous behavior between the SQS and RDS code. But I can leave it out if you like.
| public function archive(TaskLogEntity $entity) | ||
| { | ||
| $this->getPersistence()->getPlatform()->beginTransaction(); | ||
| $qb = $this->getQueryBuilder() |
There was a problem hiding this comment.
why don't we create an extension of this object that is related to spanner, i don't see the benefit in this development
There was a problem hiding this comment.
Here I'm just removing the unnecessary transaction. It's only in this PR because it removes one usage of the transaction system. If you take the changes of successive commits, everything is clearer.
|
Archive and deleteById methods don't need transaction handling since they're touching at most one line. ArchiveCollection needs it. |
gyszucs
left a comment
There was a problem hiding this comment.
I'm okay with it until it is not merged into develop since it adds hard dependency on Spanner.
This transforms the legacy transaction handling (beginTransaction, commit, rollback) to the transactional framwork provided by DBAL (Doctrine\DBAL\Connection::transactional()) and also Spanner.
Please follow the commits to understand the progressive changes.
This requires PRs from generis and tao-core: