getHibernateTemplate (). flush () is a forced sleep mode method for writing to the database (sending insert and update requests). This is done in a transaction, so it is not visible to other transactions (queries from the SQL client) until the transaction is completed.
If the insert request appears in the log, it is sent to the database. If you want to check the correct installation of the record, you can do getHibernateTemplate (). Clear () (which will delete all cached data), and then do getHibernateTemplate.get () (which will request data from the data source), Or another testing approach is to use jdbcTemplate (with the same database) to query and validate.
If the SQL client tool used allows you to specify the level of isolation — starting an SQL client session in read_uncommited isolation — allows you to see the changes made before the transaction was made.
gkamal
source share