[CXX-99] Require driver users to runGlobalInitializersOrDie Created: 20/Nov/12 Updated: 10/Apr/14 Resolved: 10/Mar/14 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Randolph Tan | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | cxxmove, legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Some of the components used by the driver (for example, DBClientReplicaSet) relies on it being called to be correct. |
| Comments |
| Comment by Pieter Willem Jordaan [ 10/Mar/14 ] |
|
I've tested preliminarily with success. I also no longer require: mongo::dbexit(mongo::EXIT_CLEAN); |
| Comment by Andrew Morrow (Inactive) [ 10/Mar/14 ] |
|
renctan I think this may be fixed now that we offer mongo::client::initialize. Can you confirm and close if appropriate? |
| Comment by Pieter Willem Jordaan [ 19/Jan/13 ] |
|
Could you please provide a snippet on how the arguments should be passed and which file to include? |
| Comment by Tad Marshall [ 20/Nov/12 ] |
|
This bit me when I tried to use a MONGO_INITIALIZER for something that it turned out was needed for a sample program to work correctly. Without something like this, we're back to using static constructors ... not nearly as nice. We could also try to come up with a way to make it easy and bulletproof. Call "initializeMongo()" before calling mongo functions, or get an error "MongoDB not initialized: please call 'initializeMongo()' first" if they try to use another API function without calling the initializer. |