Hi,

Update record problem:

I assume that you have a Header record and multiple child records for this
header. To ensure that only the changed records are saved you will have to
mark them as "Changed" from the UI. And pass only the changed ones to
Business Layer so that only changed ones are saved. Since you are saying
that you have a complex form and multiple fields then it would be even more
trickier.

You can probably manage this problem using versioning. When you are updating
the record. Mark the existing records as inactive. Increment the counter
(version) and insert the new set of records. No doubt, you will end up with
multiple versions of records but then if you have any audit requirements
that will be satisfied using this approach.

Thanks,
Milind





  -----Original Message-----
  From: Viral_Thakkar [mailto:[EMAIL PROTECTED]
  Sent: Monday, May 24, 2004 7:42 PM
  To: Struts Users Mailing List
  Cc: Dhanesh Vasandani
  Subject: Design Issue - Unchanged data getting submitted


  Dear all,



  We have a application built using Struts.



  Below is the architecture in brief :



  JSP à Action Class à Business Delegate à Session Façade à Database



  We are not using Action forms. We are using Value Objects (VO) to pass
data between web tier and App tier (from action to EJB via Business
Delegate).



  Problem:



  We have a very big form with many input fields/select fields.



  There are two scenarios

    1.. Insert the record
    This seems fine. We take all the data entered by user on the screen in
action class, create VO and pass it to EJB which inserts into database.


    2.. Update the record
    Here we have a Problem.
    Screen is populated with data retrieved from database. Here user can
update few/all fields. All the fields are under one form. User clicks on
save button. Only one Save button is available on page which submits the
complete page. The problem is that even if user does not update/add any
value and clicks on save button, all the field values (unchanged and
changed, both) will pass till EJB and the whole record in database will get
updated but in reality update require only for changed fields.

    Screen is bit complex with all types of input fields with ADD MORE and
DELETE ROWS kind of functionality also.  Screen can not have more than one
SAVE button.

    Please let us know what to use to solve such kind of performance issues.




  Thanks & Regards,

  Viral

Reply via email to