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.
OK
> 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 "
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 arg
nal Message-
> > From: Brent Johnson [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, 19 April 2005 6:32 a.m.
> > To: users@cocoon.apache.org
> > Subject: Re: Using Hibernate via Java, not Flow
> >
> >
> > Is there a way to use the filter approach to closing
gt; processed.
>
> > -Original Message-
> > From: Brent Johnson [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, 19 April 2005 6:32 a.m.
> > To: users@cocoon.apache.org
> > Subject: Re: Using Hibernate via Java, not Flow
> >
> >
> > Is there a
ilto:[EMAIL PROTECTED]
> Sent: Tuesday, 19 April 2005 6:32 a.m.
> To: users@cocoon.apache.org
> Subject: Re: Using Hibernate via Java, not Flow
>
>
> Is there a way to use the filter approach to closing hibernate
> sessions without using Spring? I'd rather not intro
Is there a way to use the filter approach to closing hibernate
sessions without using Spring? I'd rather not introduce a whole new
framework this late into the development cycle. Is it possible to use
Hibernate with Cocoon without Spring, but still encapsulating all
Hibernate calls in Java object
I'll definitely take a look at this closer next week. After doing
some reading it looks like using a Filter is really the only way to go
at this point.
As for Jakub's example, I'm using sendPageAndWait() so I don't know if
that makes a difference or not. But as I mentioned before, I
definitely d
JD Daniels wrote:
I didn't see the need for a cocoon component. I looked again, but
still can't find the article that got me going... basically here is my
setup:
I use cocoon component put method, that gets JDBC connection from cocoon
pool.
My flow looks like described in article :
function ope
I didn't see the need for a cocoon component. I looked again, but still
can't find the article that got me going... basically here is my setup:
web.xml:
contextConfigLocation
WEB-INF/ApplicationContext.xml
OpenSessionInViewFilter
org.springframework.orm.hi
Brent Johnson wrote:
I searched the Wiki for "servletfilter", "servlet-filter", "servlet
filter" and didn't find anything. Is there an example of closing
Hibernate sessions using a servlet filter on the Wiki?
Here is the wiki article I mentioned before -
http://wiki.apache.org/cocoon/CocoonAnd
beyanet.com wrote:
I use hibernate within JBoss 4 as follows:
InitialContext ctx = new InitialContext();
sessionfactory =
(SessionFactory)ctx.lookup("java:/hibernate/SessionFactory");
session = sessionfactory.openSession(); transaction =
session.begin
Brent Johnson wrote:
So can I just use the OpenSessionInViewFilter class from the Spring
framework without having to implement and/or use the complete
framework?
I'm giving a demo today of the web application so I'm taking out all
my hibernate session closes, and I'll just tiptoe around the app to
So can I just use the OpenSessionInViewFilter class from the Spring
framework without having to implement and/or use the complete
framework?
I'm giving a demo today of the web application so I'm taking out all
my hibernate session closes, and I'll just tiptoe around the app to
make sure I don't ac
Brent Johnson wrote:
I searched the Wiki for "servletfilter", "servlet-filter", "servlet
filter" and didn't find anything. Is there an example of closing
Hibernate sessions using a servlet filter on the Wiki?
I checked out the link someone posted earlier, and it describes using
a class in the Spri
I searched the Wiki for "servletfilter", "servlet-filter", "servlet
filter" and didn't find anything. Is there an example of closing
Hibernate sessions using a servlet filter on the Wiki?
I checked out the link someone posted earlier, and it describes using
a class in the Spring framework to hand
Yeah this is exactly the problem I'm having. If I close the
session and then call sendPageAndWait() I get the
LazyInitializationException. So it's been difficult for me to
decide exactly where I should close the session. But this is why
I can't figure where to make the close call.
For example:
beyanet.com wrote:
Brent,
the way I use hibernate with flowscript is to simply call the
method from flowscript and allow the java method to handle all
transaction-session open and closing processes. I place no
hibernate code in cocoon. All the hibernate code is self contained
within the java me
beyanet.com wrote:
Brent,
the way I use hibernate with flowscript is to simply call the method
from flowscript and allow the java method to handle all
transaction-session open and closing processes. I place no hibernate
code in cocoon. All the hibernate code is self contained within the
java me
Well, I tried adding in a hibernate close to get around the issue of
two different sessions monkeying around with the POJO objects,
causing an exception to be thrown (and when those get thrown the
whole application flakes out).
Brent,
the way I use hibernate with flowscript is to simply call th
I use the open Session in view model. The session lasts the duration of
the request. I can't find the article I used to get up to speed on it,
but this should get you going:
http://www.jroller.com/page/cardsharp/Weblog/open_session_in_view_pattern?catname=
Brent Johnson wrote:
Well, I tried addi
This is also a good idea because it ensures that you won't try to access
a session that has already been closed, which seemed to happen to me
quite a bit using the hibernate methods in flow.
the following works very well:
// Global Data Access Objects
var appCtx =
cocoon.context.getAttribute(We
Well, I tried adding in a hibernate close to get around the issue of
two different sessions monkeying around with the POJO objects, causing
an exception to be thrown (and when those get thrown the whole
application flakes out).
But, I'm running into a "chicken-or-the-egg" problem. If I close
the
Brent Johnson wrote:
Yeah, it just didn't feel right accessing the Hibernate calls directly
from flow. I've heard a lot about Spring, so it works well with Cocoon
and Hibernate? What kind of learning curve? I'm about halfway through
this project which has a development end date in about 2 wee
Yeah, it just didn't feel right accessing the Hibernate calls directly
from flow. I've heard a lot about Spring, so it works well with
Cocoon and Hibernate? What kind of learning curve? I'm
about halfway through this project which has a development end date in
about 2 weeks. I've got the POJO o
Brent Johnson wrote:
This is probably a simple question. I've read the Wiki about using
Hibernate and most of that uses Hibernate directly in Flow. I'd rather
not do that. I've created some "Wrapper" type classes that are intended
to be used from Flow, and they handle the hibernate sessions.
This is probably a simple question. I've read the Wiki about
using Hibernate and most of that uses Hibernate directly in Flow.
I'd rather not do that. I've created some "Wrapper" type classes
that are intended to be used from Flow, and they handle the hibernate
sessions. All they really do is r
27 matches
Mail list logo