You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Roberto Nunnari <ro...@supsi.ch> on 2007/06/21 10:49:55 UTC

integration of hibernate3 in struts2

Hello.

I'd like to ask if anyone can share his experience in integrating
hibernate3 in S2.

I believe I should use the 'Open Session in View Pattern' but
as I'm getting wierd behaviour from my S2 application I wonder
if the way I'm integrating it is bad.

I'm using a filter for hibernate in web.xml.. should I instead
use a S2 interceptor?

Any other way?

Please help!

Thank you.

-- 
Robi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: integration of hibernate3 in struts2

Posted by Roberto Nunnari <ro...@supsi.ch>.
Hi Toni.

Thank you for your quick answer.
I'm using a filter based on that described on the hibernate site:
http://www.hibernate.org/43.html

As I'm already new to S2, Tiles and Hibernate, and I have never used
Spring, I tried to limit the new tecnologies in this project by lefting
out Spring... hehe.. in fact I don't even know what a IoC container is..

Do you believe that adding Spring to my app will be a relativly
easy task? Do I have to (or should) introduce annotations, too?

--
Robi


Toni Lyytikäinen wrote:
> What kind of filter are you using? Have you made one yourself or is it the
> one from the Spring framework? If not, consider looking into Spring. Spring
> includes an OSIV filter that seems to work for me at least. I'm also using
> the Spring declarative transactions in my DAOs which makes writing database
> access code a lot less tedious. You'll also get the nice IoC container if
> you integrate Spring into your application.
> 
> On 6/21/07, Roberto Nunnari <ro...@supsi.ch> wrote:
>>
>> Hello.
>>
>> I'd like to ask if anyone can share his experience in integrating
>> hibernate3 in S2.
>>
>> I believe I should use the 'Open Session in View Pattern' but
>> as I'm getting wierd behaviour from my S2 application I wonder
>> if the way I'm integrating it is bad.
>>
>> I'm using a filter for hibernate in web.xml.. should I instead
>> use a S2 interceptor?
>>
>> Any other way?
>>
>> Please help!
>>
>> Thank you.
>>
>> -- 
>> Robi
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: integration of hibernate3 in struts2

Posted by Toni Lyytikäinen <to...@gmail.com>.
What kind of filter are you using? Have you made one yourself or is it the
one from the Spring framework? If not, consider looking into Spring. Spring
includes an OSIV filter that seems to work for me at least. I'm also using
the Spring declarative transactions in my DAOs which makes writing database
access code a lot less tedious. You'll also get the nice IoC container if
you integrate Spring into your application.

On 6/21/07, Roberto Nunnari <ro...@supsi.ch> wrote:
>
> Hello.
>
> I'd like to ask if anyone can share his experience in integrating
> hibernate3 in S2.
>
> I believe I should use the 'Open Session in View Pattern' but
> as I'm getting wierd behaviour from my S2 application I wonder
> if the way I'm integrating it is bad.
>
> I'm using a filter for hibernate in web.xml.. should I instead
> use a S2 interceptor?
>
> Any other way?
>
> Please help!
>
> Thank you.
>
> --
> Robi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: integration of hibernate3 in struts2

Posted by Roberto Nunnari <ro...@supsi.ch>.
Hello Jeromy.


Jeromy Evans wrote:
> 
>> I'm using a filter for hibernate in web.xml.. should I instead
>> use a S2 interceptor?
>>   
> I use an S2 interceptor as per the open-session in view pattern. Pass 
> the SessionFactory or EntityManagerFactory (in stand-alone mode) to your 
> interceptor through the ServletContext.

I'll look into that..
Did you write the interceptor or it already exists in S2?
What do you mean by stand-alone mode?

Thank you.

--
Robi


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: integration of hibernate3 in struts2

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
> I'm using a filter for hibernate in web.xml.. should I instead
> use a S2 interceptor?
>   
I use an S2 interceptor as per the open-session in view pattern. Pass 
the SessionFactory or EntityManagerFactory (in stand-alone mode) to your 
interceptor through the ServletContext.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org