Re: MysqlConnectionPoolDataSource - Can not insert to mysql db using jdbc?
Posted by: Filipe Silva
Date: June 13, 2018 04:55AM

Hi Ceyhan,

Thanks for this great analysis!

Can you check what is the gobal autocommit value in this server?

My guess is that it is set to `0`. Executing `change user` on the server resets all session state, meaning that the previous `SET autocommit=1` ends up being lost.

As you very nicely put in your comment, the `paranoid` flag prevents executing `change user` so the connection/session keeps all previous state and this is why it works.

If you can't set `@@global.autocommit=1` on the server, I'd say you have three options ATM. Use `paranoid=true` as you are, but this could cause you some troubles in the future; call `commit()` at the end of each modifying operation or explicitly set the session autocommit value to `1` each time you get a connection.

In the meantime you could file a bug in with all details possible so that it can be properly analyzed if fixed if it comes to it.


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.