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
7 楼
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.