0

I have an application written in PHP which uses Doctrine as ORM and bunch of code is executed within single database transaction. Once transaction gets committed, a lot of queries are executed. Is there any way to make use of "Dirty Read" in postgres?

With MySQL I used to use built into PHPStorm database tool to view database state while debugging code. However this is not the case for PostgreSql because "Read uncommitted" isolation level in this RDMS doesn't allow Dirty Read. This really makes a problem as we can't view current transaction state of database.

I know this is extraordinary question and in production we won't use Read uncommitted isolation level, however it's vital for debugging of client code. If you have any way around or anything helpful - I would really appreciate that.

rela589n
  • 817
  • 1
  • 9
  • 19
  • Postgres simply **does not allow Dirty Read**. See[Transaction Isolation](https://www.postgresql.org/docs/11/transaction-iso.html). But it is not *vital for debugging*, nobody e;se can get it either and can still debug client code. Unfortunately no help can be provided without knowledge of what your code actually is, what is should be doing, and what it is actually doing. If you post table definition (ddl), code, sample data, current results, expected results; all as text - **no images** then perhaps the community can suggest something. – Belayer Jan 12 '22 at 00:50
  • Thaks for your response! I have already sorted out the issue - it resided in vendor code. What I did to debug - modified doctrine's `EntityManager` class contents to not actually handle transactions. To such methods as `beginTransaction()`, `commit`, `rollback` the `return;` was added as first statement. Hece I could see what changes were made to database. – rela589n Jan 15 '22 at 09:51

0 Answers0