Using transactions in all CRUD operations - Mailing list pgsql-sql

From JORGE MALDONADO
Subject Using transactions in all CRUD operations
Date
Msg-id CAAY=A7-2mXGycTAjqF8xEUga5YnY8YxAZWD=YaTfooZeXq=GKw@mail.gmail.com
Whole thread Raw
Responses Re: Using transactions in all CRUD operations  (Rene Romero Benavides <rene.romero.b@gmail.com>)
List pgsql-sql
Hello,

I am developing an information system applying several design patterns being the Unit of Work one of them. For this pattern, my code automatically implements the use of transactions and this means that all of the DB CRUD operations will use them: INSERT, UPDATE, DELETE AND SELECT statements. It makes sense to me that all of these operations, except for the SELECT statement, make use of transactions. However, my Unit of Work design pattern has them implemented by default. I have read some articles about using transactions on SELECT statements and have seen that it is not as absurd as it seems to me to use transactions with only SELECT statements inside. My main reason to use transactions in all CRUD operations is to maintain my Unit of Work design pattern standard. If using transactions for all CRUD operations is not a good practice or not recommendable, then I have to choice to re-design my code

I will very much appreciate your valuable feedback on this topic.

Respectfully,
Jorge Maldonado

Libre de virus. www.avast.com

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump compatibility level / use create view instead of create table/rule
Next
From: Rene Romero Benavides
Date:
Subject: Re: Using transactions in all CRUD operations