cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent Johnson <>
Subject Re: Using Hibernate via Java, not Flow
Date Tue, 19 Apr 2005 20:32:44 GMT
> Actually, when putting all the Hibernate stuff into java you would write
> some kind of wrapper class to handle all the transactions, so that there
> would be no need to have the session as a global variable.
> To be sincere, I think you do not need it anyway ... I was just to lazy to
> pass "hs" as an argument to the helper functions all the time, and lots
> of times I use the session across different flowscript function. This is
> where
> "hs" as a global variable comes in handy. However, there is no need to
> keep the session open longer than your request lives, IMHO that would
> be problematic when you have too many concurrent connections. I have
> also written apps that do not keep "hs" global, but declare it locally when
> it's needed.

Yeah, the problem I have is that I may call 5 different methods on 3
different hibernate wrapper classes in Flow, all of which use the
hibernate session.  So I'd need a sort of "global" session that only
gets opened the first time one of the classes is called, then gets
closed by the filter.

> Regarding Spring, I simply did not know about it when I wrote the tutorial.
> It was just the way I learned to use Hibernate, and I found it quite hard to
> find some documentation at that time. I still think it is OK to use it for
> minor applications (say <10 classes), although I consider it bad practice
> now to use it for something more serious. There should be a
> "CocoonHibernateAndSpringTutorial" to make this more clear.

OK to use the tutorial for less than 10 classes?  I'm currently
working with 22 different hibernate classes, and possible more in the
future :)

So as of right now I have two options:

1)  Continue with the steps mentioned in the tutorial
2)  Stop development long enough to learn the basics of Spring and
implement it with Hibernate now before I get too deep into the web
based UI development


- Brent

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message