Re: osuser hibernate providers
Mike Cannon-Brookes <[email protected]> Mon, 05 Jan 2004 08:44:52 +1100
| Newsgroups | gmane.comp.java.open-symphony.devel |
|---|---|
| Message-ID | <BC1ED484.3FDBB%[email protected]> |
>>> USER-54 - Yes, the default is braindead because it >> needs to be. Anyone using >>> Hibernate + OSUser is strongly recommended to >> write their own DAOs and >>> ConfigurationProvider implementations to use your >> own Session management >>> strategy (ie ThreadLocal, Spring or whatever). > > I disagree with this. Default implementation shall > work well, and as > fast as possible... If anyone is strongly recommendet > to develop own DAO layer, then nobody would ever use > OSUser... Sorry, but I have to disagree. The current strategy is the best possible implementation (IMHO) on how to use Hibernate without explicit session management - yet it stinks performance-wise. However we can't do anything about that as OSUser has no 'demarcating' calls (ie .store() etc). Developers just call user.doSomething() and then user.doSomethingElse() without any start/end demarcation. As such, the only way to handle Hibernate sessions so they work out of the box is to create / destroy one for each method call. Developing your own Hibernate DAOs to use your own Hibernate session management strategy is really trivial due to all the helper methods, so I still think this is the best way to build the providers. > YOu can provide some kind of "session provider" > interface, which > provides hibernate session to DAO in standart way. And > even some > implementations - servlet filter, thread local etc. Not at all - I don't think it's OSUser's job to provide Hibernate session management tools? Mike ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click