Closed garak closed 4 years ago
Hmm weird error :confused:
I'm actually using the bundle on a project with 2 connections without any issues.
Can you share your dbal config?
Hey, thanks for the prompt response!
Here it is (with some amendments):
doctrine:
dbal:
default_connection: default
connections:
default:
url: '%env(resolve:APP_DATABASE_URL)%'
server_version: 5.7
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
mssql:
url: '%env(resolve:APP_DBMSSQL_URL)%'
server_version: 14.0.1000
orm:
default_entity_manager: default
auto_generate_proxy_classes: '%kernel.debug%'
entity_managers:
default:
connection: default
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: false
mappings:
# something probably useless in this context...
mssql:
connection: mssql
No idea yet how that error can be related to the bundle.
From what I read SQLSTATE[HY000] [2002] No such file or directory
occurs whenever the hostname/port is wrong and the connection cannot be established.
Are you sure in test env the connection url is correct?
Can you try disabling the bundle to see what happens then?
If I disable the bundle, error disappears
And this scenario also works?
mssql
and runs some queryWell, that mssql
connection is intended for production use only, indeed I don't get any MsSQL server to connect in dev/test environments.
The weird part is that error looks related to MySQL connection.
I tried to comment out mssql
config from doctrine
and it works. As soon as I re-add it, error.
Ok I see. I have an idea: we would need to make it configurable per connection if we want the transactional behavior or not.
Currently as soon as this is true https://github.com/dmaicher/doctrine-test-bundle/blob/master/tests/Functional/config.yml#L17
we will enable it for all connections.
So additionally it could be:
dama_doctrine_test:
enable_static_connection:
default: true
mssql: false
For now, I'm using enable_static_connection: false
and it works
@garak can you test this patch?
https://github.com/dmaicher/doctrine-test-bundle/compare/5.x...issue-103?expand=1
it should work with a config like
dama_doctrine_test:
enable_static_connection:
default: true
Unfortunately I'm currently on a php 7.0 project. I'll try to reproduce the problem on a different project and see if patch works
I'm sorry but I'm not able to reproduce this problem on a different project 😔
I use this bundle and it always worked seamlessly with default configuration (e.g. with a single orm/dbal config). Now I'm trying to add a second connection to a project, that it's working in dev env. But all my tests are errored, with following:
This is a stack trace: