Skip to content

fix multiple calls to reset/stop/delete projection - #140

Merged
prolic merged 1 commit into
masterfrom
fix_projection_managers
Mar 26, 2018
Merged

fix multiple calls to reset/stop/delete projection#140
prolic merged 1 commit into
masterfrom
fix_projection_managers

Conversation

@prolic

@prolic prolic commented Mar 25, 2018

Copy link
Copy Markdown
Member

resolves #138
see: prooph/event-store#329 (this has to be merged an released first, so we have tests included)

/cc @oqq

@prolic prolic added the bug label Mar 25, 2018
@prolic
prolic requested a review from codeliner March 25, 2018 10:41
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 90.395% when pulling 84826f2 on fix_projection_managers into b89aad8 on master.

@oqq oqq left a comment

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.

This change seems to work for me. But you should consider the usage of PDO::MYSQL_ATTR_FOUND_ROWS if possible to prevent this second query.

@prolic

prolic commented Mar 25, 2018

Copy link
Copy Markdown
Member Author

Nice hint, let me try that....

@prolic

prolic commented Mar 25, 2018

Copy link
Copy Markdown
Member Author

I tried this:

        if (0 === $statement->rowCount() && 0 === $statement->getAttribute(PDO::MYSQL_ATTR_FOUND_ROWS)) {
            throw ProjectionNotFound::withName($name);
        }

result:

PDOStatement::getAttribute(): SQLSTATE[IM001]: Driver does not support this function: This driver doesn't support getting attributes

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wrong ProjectionNotFound exception on resetProjection

4 participants