Closed w4-hanggi closed 4 years ago
database transaction isolation levels
@Conight But there is no write operation, it's just select operation isn't it?
@w4-hanggi In relational database:
database Read uncommitted, read committed, repeatable read, serializable
@wangzitian0 @Conight Can I remove the transaction?
I mean, there are only read(select) operations, I don't need rollback, I don't care whether the data changed during multiple operations.
I just want to show the article at that moment, because it is not a critical data, right?
And, does what you said means wrap multiple select operations in single transaction is faster than without transaction? I'm not sure about that. Will this behave differently in different databases, like: MySQL or Postgres (Because I'm using Postgresql)?
I have asked the author of gorm, and got the answer that there is no need for wrapping a transaction with multiple select operations.
Of course, if you want something about reducing dirty read, please go on.
like this:
Can someone tell me why using transaction in this part?