New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to disconnect mapnik::Map from data sources? #2554
Comments
@kking009 - could you try iterating over layers and resetting datasources - something like (untested) for (auto & layer : layers)
{
layer.datasource()->reset();
} |
Just tried it out, it didn't resolve the problem! Its logical, as reset() is a method inherited from shared_ptr.hpp and therefor it can't disconnect from the PostGIS server or unlock a shape file. |
I'd love to have the ability to disconnect. In a multi-tenant app with lots of Postgres users and therefore lots of connections, stale connections are proving to be a big problem. In fact, it'd be wonderful if connection pooling could be disabled entirely, or given very short expirations. Then we just let pgBouncer handle it all. Is there a possibility of these features being added? |
Most honest answer would be yes, we would love to have more features around postgis. However, more then likely we would need the help of someone else to do this due to time constraints. |
Understood. Well, if I ever pick up C++ for real, I'll get back to this. In the meantime, thanks for your work on Mapnik. It's a great piece of software. |
Between two map rendering sessions I want/must restart my PostGreSQL/PostGIS server. After the server start the next call to load_map ends in a Exception!
I miss a method to disconnect a Map from the Data-Sources. I could call it before I stop the server...
What I need is a kind of unload_map. The distructor of myMap is not doing the job!
My current work-around:
I deliberately run into the exception. The Mapnik now understands, that there is no connection to the data sources. The next call to load_map works again. I don't find it nice running deliberately into an exception only to disconnect from the data sources.
The text was updated successfully, but these errors were encountered: