Skip to content

[lock] Lazy create table in lock PDO store #37926

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

Merged
merged 1 commit into from
Aug 26, 2020
Merged

Conversation

jderusse
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets /
License MIT
Doc PR TODO

With this PR, the table used by PdoStore is automatically created (similar to Cache and Messenger componenents)

@fabpot
Copy link
Member

fabpot commented Aug 26, 2020

Thank you @jderusse.

@fabpot fabpot merged commit 12330e8 into symfony:master Aug 26, 2020
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Aug 31, 2020
This PR was merged into the master branch.

Discussion
----------

Change the way to create table in Lock PDO

fixes #14127
Documentation for symfony/symfony#37926

This is inspired by https://github.com/symfony/symfony-docs/blame/master/components/cache/adapters/pdo_doctrine_dbal_adapter.rst#L34-L39

Commits
-------

27f13a8 Change the way to create table in Lock PDO
@fabpot fabpot mentioned this pull request Oct 5, 2020
@jderusse jderusse deleted the lock-pdo branch October 15, 2020 10:01
@martinssipenko
Copy link
Contributor

@jderusse I know It's been a while since this was done, but could you explain why if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) { was needed? I'm specifically interested in the transactional part.

Asking this as I'm hunting down a bug and would like to understand the reason it was added there.

@jderusse
Copy link
Member Author

jderusse commented May 7, 2021

@jderusse I know It's been a while since this was done, but could you explain why if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) { was needed? I'm specifically interested in the transactional part.

Asking this as I'm hunting down a bug and would like to understand the reason it was added there.

You can not create a table when you are in a transaction except for these drivers.

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

Successfully merging this pull request may close these issues.

4 participants