Hello,
as it is possible to switch transactions between optimistic and
pessimistic during runtime, there could theoretically be one pessimistic
and one optimistic transaction updating the same table at the same time.
The optimistic one would then rely on the pessimistic one to also update
any version information.
Is this scenario supposed to be supported by the spec?
We have mappings for version information, but we currently run only
pessimistic transactions. JPOX always updates version information when
it is mapped in the metadata, be it within an optimistic or pessimistic
transaction, supporting the above use case. The updating of the version
information causes high probability of database deadlocks for us,
though, so I wonder if the version information really must be updated in
pessimistic transactions. And yes, we could also remove version
information mapping from the metadata.
Thanks for any hints,
Jörg