You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by xVik <2r...@inbox.ru> on 2006/12/10 12:04:55 UTC

how to catch render request moment

i'm using myfaces+hibernate and i have implemented session per request
hibernate pattern by filter.
but i wont to go further and handle transactions bu filter... so i open new
transaction for created session at the begining of the request and wont  to
commit transaction at the end of request

seems simple.. but if exception occures during doChain() method of hibernate
filter i need to make rollback for transaction
in theory i could catch exception in filter and everythinh will be fine, but
in practice it renders response and sends it(!!!) ..so client see
successfull action message while server side perform rollback..

QUIESTION: how to avoid this problem ???

and there is enother derived problem: when i performing transaction commit
operation in hibernate filter (after doChain) i also can get some exceptions
so i would need to roolback transaction.. but successfull responce will be
also generated :(

my try to solve this:
was to catch before render request phase of jsf.. so i make implementation
of PhaseListener (beforePhase method)... and perform commit of transaction..
so if coomit fails i throw some runtime exception... and all should be ok..
BUT myfaces catch'es my exception and successfully render response!!!

maybe there is enother way to handle request transactions? or enother
extension point in jsf applicatable for my need
-- 
View this message in context: http://www.nabble.com/how-to-catch-render-request-moment-tf2788809.html#a7780853
Sent from the MyFaces - Users mailing list archive at Nabble.com.