Re: Struts 2 hibernate session-per-request

2008-06-17 Thread Márcio Gurgel
I'm gonna try your sugestions and post the result.

Thanks a lot!

Márcio Gurgel

2008/6/17 Antonio Petrelli <[EMAIL PROTECTED]>:

> 2008/6/17 Márcio Gurgel <[EMAIL PROTECTED]>:
> > Does anyone knows how to implement a session-per-request in Struts 2?
>
> If you mean a Hibernate session, you have to implement the "Open
> Session In View" pattern, for example using a filter.
> http://www.hibernate.org/43.html
>
> If you are using Spring, there is an already implemented
> OpenSessionInView filter:
>
> http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html
>
> Antonio
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Struts 2 hibernate session-per-request

2008-06-17 Thread Antonio Petrelli
2008/6/17 Márcio Gurgel <[EMAIL PROTECTED]>:
> Does anyone knows how to implement a session-per-request in Struts 2?

If you mean a Hibernate session, you have to implement the "Open
Session In View" pattern, for example using a filter.
http://www.hibernate.org/43.html

If you are using Spring, there is an already implemented
OpenSessionInView filter:
http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html

Antonio

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 hibernate session-per-request

2008-06-17 Thread Al Sutton
I think he's trying to do whats at 
http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html without 
using the great google first :).


Al.

Laurie Harper wrote:

Márcio Gurgel wrote:

Hi Everyone,

Some time ago I asked you about a problem with old objects in session.
I noted that my application is using diferent sessions to recovery a 
data

from db.
Some times the application shows the corect result, other shows old 
results

(with old session).

I guess that if I use session-per-request I'll throw my problem away.

Does anyone knows how to implement a session-per-request in Struts 2?


The term 'session-per-request' doesn't really make a lot of sense, 
unless you are using 'session' to mean something other than a web 
application session (perhaps a database 'session'? a Hibernate 
session? something else?).


IIRC, though, your previous problem *was* about web application 
sessions, as in unwanted sharing of session-scoped data. Perhaps you 
could explain what you mean by session-per-request?


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts 2 hibernate session-per-request

2008-06-17 Thread Laurie Harper

Márcio Gurgel wrote:

Hi Everyone,

Some time ago I asked you about a problem with old objects in session.
I noted that my application is using diferent sessions to recovery a data
from db.
Some times the application shows the corect result, other shows old results
(with old session).

I guess that if I use session-per-request I'll throw my problem away.

Does anyone knows how to implement a session-per-request in Struts 2?


The term 'session-per-request' doesn't really make a lot of sense, 
unless you are using 'session' to mean something other than a web 
application session (perhaps a database 'session'? a Hibernate session? 
something else?).


IIRC, though, your previous problem *was* about web application 
sessions, as in unwanted sharing of session-scoped data. Perhaps you 
could explain what you mean by session-per-request?


L.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts 2 hibernate session-per-request

2008-06-16 Thread Márcio Gurgel
Hi Everyone,

Some time ago I asked you about a problem with old objects in session.
I noted that my application is using diferent sessions to recovery a data
from db.
Some times the application shows the corect result, other shows old results
(with old session).

I guess that if I use session-per-request I'll throw my problem away.

Does anyone knows how to implement a session-per-request in Struts 2?

Thanks so much.


Márcio Gurgel