Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    HowTo: 5.1d BatchUploader unique validation

    Hi Isomorphic,

    I want to use the BatchUploader as easy and manual interface - export data in an other system, import here.
    The items to import have an ID from the previous system that is used to identify the items here as well (unique constraint in the DB, unique validator in the .ds.xml).
    Now my upload-datasource is more virtual - accepting the rows and inserting them to the main table and child tables in its add-OperationBinding.
    I can do a type=serverCustom-validator here in order to check the new records against the existing ones, even before committing them.

    But how do I make sure that there are no duplicated records in the .csv itself? The records only exist in memory in the clientside BatchUploader.

    Thank you & Best regards
    Blama

    #2
    If there are duplicates in the CSV, they should be caught by your server-side validator. The first record should commit and the second (duplicate) occurrence will be rejected.

    Comment


      #3
      Hi Isomorphic,

      I'll mark questions here with numbers, as I assume many things don't work as expected here.

      What you describe will happen if I actually add the records - I won't see validation errors in the ListGrid, because the validation passes (there are no records with that value in the DB data so far).
      If this can't be easily solved it is also OK, because it is clearly an user error. Is it solvable(1)?


      If it is not solvable, the user has to be notified about the error.
      (2) Could you explain what the expected behavior of a setPartialCommit(PartialCommitOption.RETAIN)-BatchUploader is in this case:
      • 5 rows, 3 thereof errorfree (validation passed
      • Commit hit, 3 add requests started
      • 1 record added, 2 failed

      I'd expect a message like "1 record added, 2 records with errors" and afterwards 4 records in the BatchUploader's ListGrid. Is this assumption correct (3)? Because this does not happen for me. I see one DSResponse-failuremessage I send, but nothing else. I can provide a testcase here, if needed.

      (4) If so, does the DataSource need a PK for this? As I import data I don't have one (only synthetic sequence PKs in the application), but I'd be OK with forcing the user to have a "ID" column, basically the row number in the Excel.

      (5) Also, when you say "The first record should commit and the second (duplicate) occurrence will be rejected.", is this automatic behaviour?
      (6) Or to I have to start and commit transactions manually for every add-request inside the queue? Because for me, there is a Rollback in the very end, when at least one Add is unsuccessful.

      (7) Also, when the queue fails, I get this in the Developer Console log (using SNAPSHOT_v10.1d_2015-10-20/PowerEdition Deployment):
      Code:
      19:41:16.548:XRP9:WARN:Log:There was an error writing the contact data for the lead in the row with the rownumber "2" to the DB.
      19:41:16.572:XRP9:WARN:Log:There was an error writing the contact data for the lead in the row with the rownumber "5" to the DB.
      19:41:16.906:XRP9:WARN:Log:TypeError: _1.grid is null
      Stack from error.stack:
          BatchUploader.commit/<() @ lms/sc/modules/ISC_DataBinding.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:3434
          [c]Class.fireCallback() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:290
          [c]Class.fireCallback() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:358
          RPCManager._performTransactionReply() @ lms/sc/modules/ISC_DataBinding.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:1704
          [c]RPCManager.performTransactionReply() @ lms/sc/modules/ISC_DataBinding.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:1611
          anonymous() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:77
          [c]Class.fireCallback() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:290
          [c]Comm.performXmlTransactionReply() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:1304
          anonymous() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:77
          [c]Class.fireCallback() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:290
          Comm._fireXMLCallback() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:1284
          Comm.sendXmlHttpRequest/_13() @ lms/sc/modules/ISC_Core.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js:1291
      
      19:41:16.907:XRP9:WARN:Log:Uncaught JavaScript exception: TypeError: _1.grid is null in http://localhost:8080/lms/lms/sc/modules/ISC_DataBinding.js?isc_version=v10.1d_2015-10-20-SNAPSHOT.js, line 3434
      Best regards
      Blama

      Comment


        #4
        Hi Isomorphic,

        I created a new thread with testcase for the server-related issues (so basically the whole post#3) here.

        So the only remaining thing in this thread is this:
        "What you describe will happen if I actually add the records - I won't see validation errors in the ListGrid, because the validation passes (there are no records with that value in the DB data so far)."

        Is there a way to solve this?

        Best regards
        Blama

        Comment


          #5
          Hi all,

          this feature has been added here.

          Best regards
          Blama

          Comment

          Working...
          X