This might sound a bit silly but I have just started exploring Hibernate. My application has a large VO which will be accessed through out the application. Storing the VO in session or context,I guess, is not a good idea. So I was wondering whether Hibernate is a solution to this problem or does it try to solve something different.
I would be thankful for any information provided.
If Java had true garbage collection, most programs would delete themselves upon execution -- Robert Sewell
posted 11 years ago
Hibernate is a "bridge" between a RDBMS and the object oriented World. What you could do is store the VO in a DB trough hibernate and just pass around the primary key to the different parts of your program. and then these parts load/change/update as required. or have a filter load the VO for every request and then updating it in the end. you just store the PK in the session. but if this is faster/more performant/less memory consuming (loading/updating your VO all the time vs. just passing it around) ... i dont know.
what do you mean by "big VO" ? how big ... ? do you need this data after a session has finished ? how would you cleanup (deleting data from expired sessions. SessionListener ?) how many of these big objects ? did you notice any performace problems (dont try to solve a problem that does not exist)