Skip to content

Conversation

alquerci
Copy link

@alquerci alquerci commented Sep 16, 2018

Patch for more than one master connection.

Modern and symfony1 applications do not use Doctrine_Core::loadModels() even conservative or aggressive mode.

For such setup models that are bound to a specific connection are attached to the current connection instead of the bound one.

After some deeper investigations for the query factory the connection is set on the flow (_passedConn === false):

  • on create set the current connection
  • call preQuery() (usage like on sfDoctrineMasterSlavePlugin get the current connection)
  • on build SQL query (just before execution) it sets the query connection for each components (I do not see any check when at least two components use different connection)

Tests

Add test - https://travis-ci.org/alquerci/doctrine1/builds/429283415
Apply fix - https://travis-ci.org/alquerci/doctrine1/builds/429251947

Patch for more than one master connection.

Modern and symfony1 applications do not use `Doctrine_Core::loadModels()` even conservative or aggressive mode.

For such setup models that are bound to a specific connection are attached to the current connection instead of the bound one.

After some deeper investigations for the query factory the connection is set on the flow (`_passedConn === false`):
* on create set the current connection
* call `preQuery()` (usage like on `sfDoctrineMasterSlavePlugin` get the current connection)
* on build SQL query (just before execution) it sets the query connection for each components (I do not see any check when at least two components use different connection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant