Changes made by TransactionA not seen by TransactionB eventhough TransactionA commits them. How is that possible?
The problem was related to the fact that there was a query being executed before MasterRecordX got locked. Here is what happened:

ConnectionA starts TransactionA
RecordW is queried.
MasterRecordX gets locked for update.
...
        ConnectionB starts TransactionB
        RecordW is queried.
        MasterRecordX gets locked for update.
        ...
DetailRecordY is queried
DetailRecordY is changed
...
ConnectionA commits TransactionA
        DetailRecordY is queried
        DetailRecordY is changed
        ...
        ConnectionB commits TransactionB


Because RecordW on TransactionB was queried before DetailRecordY was changed and commited in TransactionA, the changes were not seen by TransactionB. Because of the isolation level (REPEATABLE READ), once a query is executed within a transaction, no later data changes are seen within that transaction.