[MODM-98] Partial UnitOfWork clear on runtime defaultDb change Created: 08/Dec/10  Updated: 20/Dec/10  Resolved: 20/Dec/10

Status: Closed
Project: Doctrine MongoDB ODM
Component/s: None
Affects Version/s: 1.0.0ALPHA2
Fix Version/s: None

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


 Description   

Actually I am not sure if this is a bug or just ODM limitation, but there is a use-case for MongoDb which doesn't fit well with current ODM implementation.

Imagine SaaS service, where each client has his own DB. Documents and collections are all the same, except most of them are stored in different DBs, depending on context.

It works pretty well with ODM defaultDB configration setting, until you need to process data from different dbs (e.g. iterate db by db in CLI script). When you try to change default db, repositories and persisters stay there and all keep a reference to initial DB. And they don't get reset on UnitOfWork->clear(). It would be great to have runtime defaultDb switching out of the box, but if that is a problem, maybe you can advice on how this could be handled?



 Comments   
Comment by Jonathan H. Wage [ 20/Dec/10 ]

Hi, this is actually by design. The configuration is not something you change at runtime. I think in your case you need to be working with multiple DocumentManager instances.

Generated at Thu Nov 27 08:40:30 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.