Question about the onDisable() method

  • regarding the onDisable() method of a plugin, If I execute a series of Insert, Update, and Delete statements in that method will my SQLite database be actually written to or will they all be ignored and the plugin will just shut down without doing anything?

  • Basically it's safe to do any SQL statements in the "onDisable()" method. However, you should not only rely on this method: it does not get called in every situation, e.g. if the server process was killed (instead of using the shutdown command), the onDisable() method will never be called.
    So if you want to save some stuff, it's recommendable to have a timer which executes the statements every 10 or 20 seconds (but of course it's also a good idea to execute the statements in the onDisable() method as well) :)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!