Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-98

Partial UnitOfWork clear on runtime defaultDb change


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.0.0ALPHA2
    • Fix Version/s: None
    • Component/s: None
    • Labels:


      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?


        Vladimir Razuvaev created issue -
        Jonathan H. Wage made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Invalid [ 6 ]


          • Assignee:
            Jonathan H. Wage
            Vladimir Razuvaev
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: