java - How to inspect data within a database transaction? -


i'm running integration test executes hibernate code within single transaction (managed spring). test failing duplicate key violation , i'd hit breakpoint before , inspect table contents. can't go mysql workbench , run select query outside transaction. there way?

after reading comments, impression predominantly interested in how hit breakpoint , @ same time able examine database contents. under normal circumstances offer log sqls. having breakpoint in mind suggestion is:

reduce isolation level read_uncommited integration test.

reducing isolation level allow see uncommitted values in database during debugging. as long don't have parallel activity within integration test. should fine.

isolation level can set on per connection basis. there no need done on server.

one side note. if using hibernate parallel activities may work fine when reduce isolation level because largely hibernate behaves in repeatable_read because of transactional level 1 cache.


Comments