z**r 发帖数: 13 | 1 for stateless EJB, do you handle rollback manually,
or just throw runtimeexception? | g*****g 发帖数: 34805 | 2 I don't do ejb2 any more, but I think if you do cmp, you should just throw
exception and let the framework deals with it.
【在 z**r 的大作中提到】 : for stateless EJB, do you handle rollback manually, : or just throw runtimeexception?
| t*******e 发帖数: 684 | 3 The rules are the same across the board, no matter what technology you use. Runtime errors (system errors) cause transaction rollback automatically, checked exceptions (app errors) by default do NOT roll back transactions. But you may explicitly call or configure a txn roll back on application errors. | z**r 发帖数: 13 | 4 the tricky part i know is, if you throw a runtimeexception,
the container rolls back for you, and invalidates the bean instance.
when system is under heavy load, those beans would cause GC disater.
【在 g*****g 的大作中提到】 : I don't do ejb2 any more, but I think if you do cmp, you should just throw : exception and let the framework deals with it.
|
|