mtangoo / wxDatabase

wxWidgets library for connecting to major relational database
http://mtangoo.github.io/database/index.html
36 stars 16 forks source link

PGS: Fix Perfomance issue #7

Closed mtangoo closed 8 years ago

mtangoo commented 8 years ago

From PGS Docs page

Note: On Windows, there is a way to improve performance if a single database connection is repeatedly started and shutdown. Internally, libpq calls WSAStartup() and WSACleanup() for connection startup and shutdown, respectively. WSAStartup() increments an internal Windows library reference count which is decremented by WSACleanup(). When the reference count is just one, calling WSACleanup() frees all resources and all DLLs are unloaded. This is an expensive operation. To avoid this, an application can manually call WSAStartup() so resources will not be freed when the last database connection is closed.

Fix this in PGS port

mtangoo commented 8 years ago

This should be called by application, since the library does not have Init/Uninit functions