struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dhaliwal, Pritpal (HQP)" <>
Subject RE: Using Validator To Avoid Database Trip
Date Tue, 03 Feb 2004 18:33:06 GMT
Things like Hibernate (ORM layer) might do some of these tricks for you. 

I think it only updates what has been changed and if you use caching, you
are optimizing many other things..

Pritpal Dhaliwal

-----Original Message-----
From: Slattery, Tim - BLS [] 
Sent: Tuesday, February 03, 2004 7:12 AM
To: 'Struts Users Mailing List'
Subject: RE: Using Validator To Avoid Database Trip

> I have an "Edit Existing Record" screen. When the user clicks
> the Save button on this screen, I'm supposed to store the 
> changed data in the database. However there may be a 
> situation where the user leaves the data unchanged & still 
> presses the Save button. In this case, I want to avoid the 
> database trip. Can I achieve this using the Validator 
> framework? 

I can't see how Validator would help. I handle this by including a hidden
element in the page which contains the original value of the data. When the
form is submitted, I can compare that hidden value to the value that was
exposed to the user. If they differ, then the database needs to be updated.

Tim Slattery

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message