I am writing a little auction app, and it is very important that my bids are recorded with certainty. After all, the last couple seconds of the auction are critical moments for the buyers, and I can't risk them simultaneously bidding and having a race condition.
And of course, that's what transaction isolation is for. I can set my isolation level to serializeable, and we're all set.
But what about all the other requests? If people are viewing profiles, or sending messages, these requests don't need anywhere near that kind of transaction isolation. A read committed isolation level is perfectly acceptable for those requests.
I'm setting my transaction level as part of my hibernate property hibernate.connection.isolation
, but I'd really like to be able to do something like session.setTransactionIsolation(newIsolation)
per request.