You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Murali Ravipudi <mu...@adp.com> on 2004/04/28 12:10:43 UTC

Struts with OJB

Hi,

I am using Struts 1.1 with OJB 1.0rc5. In my application, there is a "list
items" page where items are listed. 
I get the items to be displayed into an ArrayList using OJB and do
request.setAttribute("RESULT", allItems);
In the JSP, I request.getAttribute("RESULT"); and <logic:iterate . . .> to
display. 
The problem I am facing is this: when an item is edited using this
application, the changes are propogated to the database, but on visiting the
"list items" page again, I do not see the updated item. It shows the old
version.
I could not find out where the old version is being cached. 
Any clues on this are appreciated.

Thanks
Murali






This message is confidential and may also be legally privileged. If you are not the intended recipient, please notify postmaster@adpwilco.com immediately. You should not copy it or use it for any purpose, nor disclose its contents to any other person. The views and opinions expressed in this e-mail message are the author's own and may not reflect the views and opinions of ADP Wilco.


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


RE: Struts with OJB

Posted by Daniel Perry <d....@netcase.co.uk>.
Assuming you aren't storing them beyond a single request, the items are
being cached in OJB.  You need to clear the cache after updating objects.

To fix this, after any inserts/updates in your java code, do:

PersistenceBrokerFactory.defaultPersistenceBroker().clearCache();

Daniel.

-----Original Message-----
From: Murali Ravipudi [mailto:murali_ravipudi@adp.com]
Sent: 28 April 2004 11:11
To: 'Struts Users Mailing List'
Subject: Struts with OJB



Hi,

I am using Struts 1.1 with OJB 1.0rc5. In my application, there is a "list
items" page where items are listed.
I get the items to be displayed into an ArrayList using OJB and do
request.setAttribute("RESULT", allItems);
In the JSP, I request.getAttribute("RESULT"); and <logic:iterate . . .> to
display.
The problem I am facing is this: when an item is edited using this
application, the changes are propogated to the database, but on visiting the
"list items" page again, I do not see the updated item. It shows the old
version.
I could not find out where the old version is being cached.
Any clues on this are appreciated.

Thanks
Murali






This message is confidential and may also be legally privileged. If you are
not the intended recipient, please notify postmaster@adpwilco.com
immediately. You should not copy it or use it for any purpose, nor disclose
its contents to any other person. The views and opinions expressed in this
e-mail message are the author's own and may not reflect the views and
opinions of ADP Wilco.


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



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