On Mon 19 December 2005 13:19, Cosmin Bucur wrote: > > It's starting to sound like shaky ground , and problems if i use the > wrong aproach . So basically one approach coculd give me scalability > issues in terms of mixing session data , and the other one is resource > wastefull having to open and close a session for each request . ( > alltough in my scenario that wouldn't be such a big issue ) . > The best approach is to use the Spring-supplied hibernate filter, that opens a session and keeps it open for a single request-response cycle. This approach ensures that all data access occurs within an already opened session. It isn't wasteful and it scales well.
The only problem with the approach I described, with the HibernatePropertyPersistenceStrategySourceImpl (and this applies to any means of storing loaded objects outside the database) is that the data becomes stale and is out of sync with more up-to-date transactions. For data that is fairly static this often isn't a problem, but for highly transactional data it can cause problems. So in those cases it is better to store only primary keys, and reload the object from the database as needed. regards, Scott --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
