When does Hibernate Session.load() throw an exception
try { x = session.load(...); y = x; } catch(Exception e) { //do something } If the key is not present, will load(...) throw an exception right away will return a proxy and then throw an exception when the object is trying to be obtained from the db later? Also, in the code above, if the execution reaches the assignment y = x, is it guaranteed that at that point, x is not null? Are there situations where x can be null at that point? In short: x will not be null after the load, so neither will y There may or may not be an exception from load() if the object doesn't exist If there is no exception