You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by JD Daniels <jd...@kismetsoftware.com> on 2005/04/13 20:17:55 UTC

Re: Using Hibernate via Java, not Flow

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(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
var service = appCtx.getBean("javaServiceClass");

function removals_summary_view()
{
     var beans = service.getBeans();
     cocoon.sendPage("internal/generate-view/bean_summary", {title : 
"Beans",beans:beans});
}


Leszek Gawron wrote:
> 
> I deeply recommend you not to use hibernate directly but put all your 
> data access code and service layer into spring framework. Then you 
> simply query spring context from servlet context, lookup appropriate 
> service bean and perform some actions.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org