[SOLVED] [API 7.1.0] Databases Not Working

Hello! I am currently trying to make a “tagging” system in my plugin, as a debugging feature for databases. For some reason though, the data isn’t being saved to the database. I’m not quite sure why this isn’t working, so I’d like some help.

You can find the service used for “tagging” in the TagService class (package “ext.tpz.plasma.service” [make sure you’re in the api7.1 branch]).
GitHub page

EDIT: I believe the problem is that I forgot to actually insert the values into the database :stuck_out_tongue:

EDIT 2: I have fixed that problem, but it still doesn’t work correctly (the data won’t persist between server restarts).

seems like he did not turn on auto-commit, so you’d have to manually commit changes.
Afaik to enable this you’d have to edit his code to .setAutoCommit(true) on the Connection-Object after getting it, or .commit() manually before closing the Connection.
Since you say the data persist while the server is running you could try to call this:

Connection con = SQLService.getDataSource().getConnection();
con.commit();
con.close();

Edit: commit either when the server shuts down or after you made changes

1 Like

Ok. Thanks for the help.