Poco 1.5.2 - Ubuntu x64
my problem is as follows:
I've written a plugin for my app that links dynamically to libPocoDataMySQL.so.22 and its deps. When I try to load it either with ClassLoader or directly by dlopen() the program hangs. The reason is when dlopen() calls _init on the plugin .so lib the MySQL::Connector::registerConnector() is called automatically which causes libmysqlclient18 to deadlock (v. 16 seems to work normally?).
I didn't know how to prevent it. I tried to define POCO_NO_AUTOMATIC_LIB_INIT before including Connector.h to no avail. I even removed the whole auto-init part from Connector.h still hangs.
Then I came across this line in Connector.cpp:
const MySQLConnectorRegistrator pocoMySQLConnectorRegistrator;
which seems to instantiate the registrator regardless of POCO_NO_AUTOMATIC_LIB_INIT. (Please correct me if I'm wrong!).
So what I did was I commented out the line:
from the MySQLConnectorRegistrator constructor __and recompiled libPocoDatMySQL.so__
This finally did the trick!
Is there a simpler way to prevent auto initialization of mysqlclient?
I'm still learning this lib so I could have done something wrong...