I recently learned that when we do an explicit flush the data is moved to DB but its isolated and only visible to current transaction and hidden from other threads and transactions.
So my question is if I have a multi-threaded application
- First thread in Transaction1 updates an entity and flushes but haven't finished the transaction
- Second thread in Transaction2 updates the same entity and flushes, this transaction is cannot see the data flushed by the Transaction1 so will this cause an Optimistic Lock Exception?