The real problem is NOT that I have 2 transactions in one session, though it could be the case.
Typically you have 2 phase in a request:
Update Data
Load data and render your page.
The second phase is supposed to pick up the latest data. What about another request updated the data after you updated your data?
The rendering process really should NOT be in the same transaction in your updating process, and a transaction really should NOT be that long.
sergey wrote:
Well, if you often have to process two unrelated transactions in one request, you will have to design your application differently and open two sessions during the request.