-
1. Re: LIE when exception return rollback
alessandro Mar 28, 2008 8:35 PM (in response to alessandro)if rollback: false, not occurs problems, but I need rollback: true
-
2. Re: LIE when exception return rollback
alessandro Mar 28, 2008 8:39 PM (in response to alessandro)... the flush-mode is MANUAL.
-
3. Re: LIE when exception return rollback
pmuir Mar 29, 2008 7:30 PM (in response to alessandro)When is
later
? -
4. Re: LIE when exception return rollback
alessandro Mar 31, 2008 7:10 PM (in response to alessandro)Sorry, I wanted to say 'after' no 'later':
'... after launch the exception.', can't access the associations without a LIE. -
5. Re: LIE when exception return rollback
christian.bauer Mar 31, 2008 7:26 PM (in response to alessandro)You can NOT ever access a persistence context after an exception. RuntimeException is FATAL and NOT recoverable gracefully. This is covered in any documentation on the subject.
-
6. Re: LIE when exception return rollback
christian.bauer Mar 31, 2008 7:27 PM (in response to alessandro)And the same is true for a rolled back Exception (@ApplicationException marked rollback). The state of the persistence context is undefined at that point.
-
7. Re: LIE when exception return rollback
alessandro Mar 31, 2008 8:06 PM (in response to alessandro)What should I do then? If all exceptions (including domain exceptions) lose the persistence context...how to ensure that the application is behaving in manner expected (my objects working fine)?
-
8. Re: LIE when exception return rollback
christian.bauer Mar 31, 2008 8:17 PM (in response to alessandro)An Exception is an exceptional case. It should not be abused for control flow. Write program logic that does not result in exceptions or rely on exceptions for the correct flow of instructions.
-
9. Re: LIE when exception return rollback
alessandro Mar 31, 2008 10:23 PM (in response to alessandro)I do not use exceptions to control flow. I to build a filter to remain on the same page (the Seam does not offer it):
http://seamframework.org/Community/ExceptionHandlingProblem201GAEmptyViewid#comment12283
All applications have
Domain Exceptions
... it's normal to interact with incorrect values placed by users. If I have a Domain Exception, my object in conversation lost your association objects? This seems correct? -
10. Re: LIE when exception return rollback
christian.bauer Apr 1, 2008 6:50 AM (in response to alessandro)
Alessandro Lazarotti wrote on Mar 31, 2008 10:23 PM:
I do not use exceptions to control flow. I to build a filter to remain on the same page (the Seam does not offer it):This is a contradiction. Of course that is control flow. On the other hand, rolling back transactions is not part of the regular flow of the application. It's an exceptional case used to handle fatal application errors in a graceful fashion.
All applications haveDomain Exceptions
... it's normal to interact with incorrect values placed by users.You do not handle
incorrect values
by throwing them against the database, see what sticks, and then roll back the transaction if it didn't work. You check before. This is called validation.The problem is the rollback, not the application exception. The rollback says
handle this like a RuntimeException
to the persistence provider. Which means it kills the persistence context.
If I have a Domain Exception, my object in conversation lost your association objects? This seems correct?I don't understand that sentence.