'Can NHibernate long session (pattern) have multiple transactions that update data?

I am looking at the NH documentation. The example in the section - 12.5. Session disconnection - illustrates a long running session. However I wasn't expecting the first transaction to save anything. Now if the second transaction fails and subsequently rolls back, won't the data be inconsistent (unless the application code does a rollback)?

Also, the example seems to go against what is discussed in section - 12.4. Optimistic concurrency control.

A single application transaction usually spans several database transactions. It will be atomic if only one of these database transactions (the last one) stores the updated data, all others simply read data.

See how it says only the last transaction should do save/update, contradicting the example where both transactions either saves or updates.

Am I missing something or are the examples wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source