So I’ve come across this issue, where the
DataSource I get by opening a JDBC-MySQL URL through the
SqlProvider gets closed before
GameStoppingEvent has been executed.
The docs (https://docs.spongepowered.org/stable/en/plugin/database.html) clearly state to not store
Connections. But no word about
DataSources. And from my perspective that makes sense as creating a
DataSource involves at least some kind of parsing the string, etc. So I naturally stored the
DataSource I get from the
DataSource gets closed before the
GameStoppedEvent). I mean most plugins using database stuff do at least some kind of cleanup during that stage so I think it’s too early to do it before the event. (After should be fine).
Though if it is intended and the call to get the
DataSource is also very inexpensive, it should be also mentioned on the docs.
In any case the example should be extended to show that you either can keep the
DataSource or that you can’t.
Now it also mentions that
JDBC URLs should be obtained from
but no example is provided and I honestly don’t have the slightest clue what I should do with that method.
Pass my entire URL to it?
mysql to it?
An example on how to use that would be more than apprechiated.
Now to make this clear, this not a complaint or anything, rather me asking for clarification as I’ve recieved contraticory infomation and some information just seems to contradict common sense/experience.