Closed f4lco closed 6 years ago
I suggest that you let the getter establish a connection if no connection exists. Can you make a pull request for that small change so to get this blocking issue fixed as soon as possible?
Fixed with d5d02b73f241ca8d0e70a3f16f22f602e6e761c7
Given the following algorithm
It turns out that the connection is indeed
null
. This is due to the fact that once aDefaultDatabaseConnectionGenerator
crosses process boundaries, it looses its non-serializable connection object. Internally methods likegenerateResultSetFromSql
check for a missing connection and re-establish it as needed, meaning the connection is only available if at least one query was fired through the dedicated methods. If the connection should be accessed before that one is out of luck.Possible workaround: fire a no-op SQL query like
select 1 union select 1
in order to be able to access the connection.Possible fixes: re-establish connection as early as possible after deserialisation; or make the getter have the same side effect as the query methods.
This possibly also affects the usefulness of the new accessor for
DatabaseConnectionGenerator
s inTableInputGenerator
s in https://github.com/HPI-Information-Systems/Metanome/pull/384.