I'll just try to answer the second question. From what I understand, the second transaction will not be able to execute the update, because, with managed versioning, the update clause includes a where condition - WHERE version = <version read by the transaction>. If the version was incremented by another transaction in the meantime, the where will not be matched, and the second update will not succeed. This will return 0 as the number of updated rows, which will cause Hibernate to throw a stale data exception.
|