Fixed issue #2228
Refactoring of OTransactionOptimistic. Fix warnings.