Enable basic RDF transaction isolation (was none)#304
Conversation
|
|
||
| def transact(action: RepositoryConnection => Unit): Try[Unit] = transact(action, None) | ||
| def transact(action: RepositoryConnection => Unit): Try[Unit] = | ||
| transact(action, Some(IsolationLevels.READ_COMMITTED)) |
There was a problem hiding this comment.
I think we should set some isolation level (otherwise why use transactions at all), but why are we choosing READ_COMMITTED specifically? I would prefer to always use the strongest isolation level possible as default, unless we hit practical limitations, since resource usage is easier to fix than data corruption (even though in our case we have rdflog, so we are still fairly safe).
Even if we do, I think we should still use SERIALIZABLE as the default, and adjust usages of Repository.transact where we hit performance issues to a weaker isolation level, while also making sure that the code within that transaction actually is not expecting a higher level.
I would maybe even prefer that we don't have a default isolation level at all, since that choice should depend on the logic inside the transaction, but I think defaulting to SERIALIZABLE is still okay.
There was a problem hiding this comment.
Yes, good question. I would think that READ_COMMITED should be good enough for our use case, but it could also be worth to review the transact call sites.
|
Converted this to draft since it still requires some decisions regarding which transaction level to use. Also, if we move to a relational DB, this issue is not relevant. |
No description provided.