Results 1 to 3 of 3

Thread: Avoiding unneeded updates

  1. #1
    Join Date
    Aug 2004
    Location
    Los Angeles, USA
    Posts
    62

    Default Avoiding unneeded updates

    Hello,

    I am using Hibernate with Spring in a web form based application. When users browse through a form (clicking "next" or "back"), and they do not make changes to the fom data, I want to avoid an update statement from being executed on data that has not been changed. Is there any way to avoid these unneeded updates?

    Thanks.

  2. #2
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    Well, you can set your transactions to readonly if you know you will not be updating the data. In that case, the commit and flush would not be called.

    Take a look at the Transaction section of the Spring manual for info on doing this.

    Regards,
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

  3. #3
    Join Date
    Aug 2004
    Location
    Los Angeles, USA
    Posts
    62

    Default

    The problem is that you do not know if the user has changed data. For those pages where he made a change you want to issue an update, for those that he left unchanged, you want to do nothing.

Similar Threads

  1. Avoiding UI-centric Domain Classes
    By dhainlin in forum Web
    Replies: 5
    Last Post: Mar 27th, 2006, 01:16 PM
  2. Replies: 3
    Last Post: Sep 8th, 2005, 03:41 PM
  3. GlazedTableModel updates
    By lstreepy in forum Swing
    Replies: 10
    Last Post: Sep 8th, 2005, 02:58 PM
  4. Replies: 0
    Last Post: Sep 8th, 2005, 04:27 AM
  5. Batch Updates with Statement
    By SZ in forum Data
    Replies: 5
    Last Post: Mar 10th, 2005, 01:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •