i may have missed something about session-per-application-transaction pattern
let's take a concrete example:
----------Application Transaction-------------
------------Hibernate Session-----------------
---- R1----|-----R2------|------R3-------------
---- T1----|-----T2------|------T3-------------
where R1,R2 et R3 are httpRequests and T1,T2,T3 are underlying db transaction.
Between each httpRequest, we have a session.disconnect().
R1 --> select object (+detache object to send to jsp)
R2 --> reattach object + updates (if session.update() is called, version is incremented), what may we do here commit or rollback (i don't want to commi the application transaction)
R3 --> some other updates + validation per user to say "ok go for commit" (i want the application transaction to be comitted)
We must finish the db transactions (if not, we're going into db lock if we updated something in the session), to do it two choices:
- commit, and so our application transaction have no sense, the transaction aspect is lost
- rollback, and with it session has stale data in case of versionning for example
Is the solution to set flushMode=commit ?
_________________ Anthony, Get value thanks to your skills: http://www.redhat.com/certification
|