Alex Alex - 25 days ago 11
MySQL Question

mysql-workbench does not see database changes made by other clients unless restarting connection

I use mysql-workbench in order to query my database tables.
Also I use a Java application (with

mysql-connector-java
) in order to make changes to my database.

Every time the java app modifies the database I am unable to see the changes using mysql-workbench. The query return no results.

Only after I restart the MySQL Connection and run the query again, I am able to see the changes.

I use
mysql-workbench version 6.3.8
,
mysql Ver 14.14 Distrib 5.7.16
,
mysql-connector-java 5.1.38
and my OS is
Ubuntu 16.04 LTS
.

From the Java application I use this code in order to modify the database state:

Transaction transaction = session.beginTransaction();
.....
session.save(myObject);
transaction.commit();


Is this a known issue?

Answer

You probably have no auto commit enabled, hence changes are not visible to any other client until you explicitly called commit. You can test this also with the command line mysql client and it will give you the same result. A similar question has been asked a few days ago: Mysql Workbench is not reading records inserted through JDBC