Skip to content
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

Do not use deprecated postConnect event but rely on savepoints instead #232

Merged
merged 6 commits into from
Apr 19, 2023

Conversation

dmaicher
Copy link
Owner

@dmaicher dmaicher commented Oct 27, 2022

Fixes #241

@dmaicher dmaicher force-pushed the remove_post_connect_event branch from 77acbb8 to 3e1fc5b Compare April 19, 2023 07:05
@dmaicher dmaicher merged commit 629d385 into master Apr 19, 2023
@dmaicher dmaicher deleted the remove_post_connect_event branch April 19, 2023 07:10
{
return $this->underlyingDriver->getSchemaManager($conn, $platform);
}
$platform = isset($params['serverVersion'])
Copy link
Contributor

@bendavies bendavies Jul 26, 2023

Choose a reason for hiding this comment

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

hi @dmaicher.
i think there is a bug here.
given config like

when@test:
    doctrine:
        dbal:
            connections:
                default:
                    dbname_suffix: '_test%env(default::TEST_TOKEN)%'
                    platform_service: App\PostgreSQLPlatform
                    use_savepoints: true

my custom platform service is ignored and not used here.
I thnk we need to use $params['platform'] if set, as per https://github.com/doctrine/dbal/blob/62cce0a4486ce8757fa43a3f72d95a81b89da9e7/src/Connection.php#L198

Copy link
Owner Author

Choose a reason for hiding this comment

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

Oh indeed. Looks like I missed that case. Its deprecated and won't work with DBAL 4 though.

Are you up for creating a new issue for it + look into fixing it? 😊

Copy link
Contributor

Choose a reason for hiding this comment

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

yep, i'll fix it!
what has changed in dbal4?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

ah right, i assume there is a change in doctrine bundle to support this...

Copy link
Owner Author

Choose a reason for hiding this comment

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

The platform_service option is deprecated on DoctrineBundle. I think there is no out-of-the box solution yet. Might involve creating a custom middleware + registering it.

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.

Exception "May not alter the nested transaction with savepoints behavior while a transaction is open."
2 participants