Skip to content

[Messenger] Doctrine Transport not compatible with SQL Server #32585

@dlegatt

Description

@dlegatt

Symfony version(s) affected: 4.3.2

Description
Doctrine DBAL throws the following exception when using messenger with the Doctrine transport and a SQL Server database.

sqlsrv does not support named parameters to queries, use question mark (?) placeholders instead.

How to reproduce
Create a new symfony project and install messenger:

symfony new messenger-doctrine-sqlsrv --full
cd messenger-doctrine-sqlsrv
composer req messenger

Configure .env for the database DSN and messenger transport DSN

.
.
DATABASE_URL=sqlsrv://sa:Password01@127.0.0.1/test_db
.
.
MESSENGER_TRANSPORT_DSN=doctrine://default
.

Configure messenger.yaml

framework:
    messenger:
        transports:
             async: '%env(MESSENGER_TRANSPORT_DSN)%'
.
.

Configure doctrine.yaml

doctrine:
    dbal:
        driver: 'sqlsrv'
        charset: UTF-8
        default_table_options:
            charset: UTF-8
.
.

From the terminal, run ./bin/console messenger:consume

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy