When using Hibernate Session, when should I use load and when should I use get. I have been using load, but I always run into the issue when one of my objects with the same id is already loaded into the session. I don't mind getting the Session cached copy.
I think Session.get will fix my problem, but I am not sure when should I use either one. I also understand that get can return a null while load will throw an exception. I am looking for some general guidelines.
TIA
Hibernate version: 2.1.4
Mapping documents: None
Code between sessionFactory.openSession() and session.close():
Person p = new Person();
session.load(p,fomrBean.getPersonID());
Full stack trace of any exception that occurs: NA
Name and version of the database you are using: Mysql 4.1.08
Debug level Hibernate log excerpt:NA
_________________ --------------------------------------------------
To code or not to code... Is that a question?
--------------------------------------------------
Pritpal Dhaliwal
|