[MODM-124] ClassMetadata shouldn't store defaultDb value Created: 18/Feb/11  Updated: 04/Mar/11  Resolved: 04/Mar/11

Status: Resolved
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: 1.0.0BETA2
Fix Version/s: 1.0.0BETA3

Type: Bug Priority: Major
Reporter: Vladimir Razuvaev Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None


 Description   

Currently if document doesn't have "db" mapping, it is taken from defaultDb configuration and assigned to classmetadata (in ClassMetadataFactory).

But if we have two documentManagers with different defaultDb configuration, second manager's configuration will be ignored, because "db" value is already set in classMetadata (when the 1st manager was created).

It gets worse with metadata caching, as defaultDb setting is only taken in account when metadata is stored in cache.

This affects a common use-case, when each customer has his own database and defaultDb is defined at runtime.



 Comments   
Comment by Jonathan H. Wage [ 04/Mar/11 ]

Hi, this is fixed here https://github.com/doctrine/mongodb-odm/commit/6b91d944e68bbf94702a38351f03c74b7d6a057a

Thanks for reporting the issue.

Generated at Tue Sep 02 14:30:06 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.