You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2008/06/03 21:12:28 UTC

Re: Struts 2 + Hibernate question

Márcio Gurgel wrote:
> Hi all!
> 
> I'm using struts 2 + hibernate.
> I've a strange problem, if someone could give me a hand I'll be so tankfull..
> 
> If I persist a object in my app every things go well and all relationchips
> are stored correctey correctly.
> The problem occours when I update this object... After the update all data
> are stored correctly too, but the problem is that my page shows the old
> object (different from database).
> 
> This could be some kind of cash from struts 2? Or my problem is just
> hibernate?
> 
> I tryed this methods to force a refresh after bring the object from database
> session.refresh(obj)
> session.flush()

I can tell you that Struts doesn't cache your data anywhere for you. You 
may be storing a reference in the session or some other web-tier scope, 
holding it in a static field or otherwise keeping a stale reference 
somewhere. Or you may be seeing client-side page caching or even 
mis-configured caching at the Hibernate or database level.

You'll need to trace through your data access paths to determine at what 
point you're picking up the stale reference, and then figure out where 
that's coming from.

L.


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


similar problem

Posted by kattenok <an...@yandex.ru>.
I have similar problem. On one page of my site I configurate some settings
(forexample  attribute "country" set true). That changes set to data base (I
cheked it). Then I go to other page , where (if attribute "country" is true)
textbox "country"  is visible, but it isn't. The problem that nhibernate 
returns old value ("country" is false). And  there is one more strange thing
- nhibernate  cat return right value for fist load of page and old value for
second (if i press F5 ), or old value for fist load and right value  for
second or for third.
In other words if i press F5 I can't be sure what value I get(right or old).
Please help me.
-- 
View this message in context: http://www.nabble.com/Struts-2-%2B-Hibernate-question-tp17527841p18647606.html
Sent from the Struts - User mailing list archive at Nabble.com.


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