gavin wrote:
However, it is VERY easy to write a wrapper for the Hibernate Session that converts exceptions, or to use a fwk like Spring that does this.
Can you clarify how you see it done? Somehow, I see it as follows. A better way? Thanks
Code:
public class MySessionWrapper {
private Session hbSession;
// dispatch [b]ALL[/b] hbSession methods as follows
public Transaction beginTransaction() {
try {
return hbSession.beginTransaction();
} catch (Exception e) {
throw new RuntimeException("Whatever ...");
}
....
}