Skip to content

Feature/nex 519/add transactional - #104

Open
julien-sebire wants to merge 9 commits into
fix/NEX-517/spanner_supportfrom
feature/NEX-519/add-transactional
Open

Feature/nex 519/add transactional#104
julien-sebire wants to merge 9 commits into
fix/NEX-517/spanner_supportfrom
feature/NEX-519/add-transactional

Conversation

@julien-sebire

@julien-sebire julien-sebire commented Nov 12, 2019

Copy link
Copy Markdown
Member

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:

use Doctrine\DBAL\Schema\SchemaException;
use Exception;
use InvalidArgumentException;
use Google\Cloud\Spanner\Transaction;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should not do this, connection the Rds with the Cloud\Spanner is not the best option

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread model/QueueBroker/SqsQueueBroker.php Outdated
$logContext = [
'QueueUrl' => $this->queueUrl
];
$logContext = ['QueueUrl' => $this->queueUrl];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we touching this ?
SqsQueueBroker which is for using AWS SQS. -- and this will be a google cloud platform solution

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't we create an extension of this object that is related to spanner, i don't see the benefit in this development

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@julien-sebire

Copy link
Copy Markdown
Member Author

Archive and deleteById methods don't need transaction handling since they're touching at most one line. ArchiveCollection needs it.

@gyszucs gyszucs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with it until it is not merged into develop since it adds hard dependency on Spanner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants