> Perhaps, I think it depends on what the defaults are. But we are back to
> using status codes or exceptions discussion :-)
I thought we were over that ;-) I can of course only speak for my use
cases, but status codes would certainly not work for me (and I'd argue
that my use case is not that uncommon).
> Right, but you are defining a convention that may not work in all cases. But
> i think that is OK as long as you are clear on what that convention is.
Yes, that is of course true. Assuming that resources (and thus user
code) somehow gets hold of a session, it can of course manually commit
or checkpoint if it needs to, and beyond that my package could define
additional hooks for users as needed.
> By the component that performs the commit or rollback, that same component
> that checks for the response state. Then you can check if the exception was
> mapped and if so what the type of the exception was.
Could you sketch some sample code? Will this be a JerseyFilter or
something similar? Or are you thinking of a ContainerResponseFilter?
But that won't work as it is now, because of course the response
filters happen before the response is written.
Martin