Uploaded image for project: 'AdMaxLocal'
  1. AdMaxLocal
  2. AML-68

OPTUS- Loadscript & datafeed: Null entry to "optus.businessLocationIDMap" is causing Datafeed to FAIL.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.0
    • Fix Version/s: 1.1.1
    • Labels:
      None

      Description

      Null entry to "optus.businessLocationIDMap" is causing Datafeed to FAIL.

      Steps to reproduce :

      1.Login to SMB1 server and cd /home/gsingh/git/optus/system/db-structure/smb-services/databases/mms_common/data

      2. Modify business_locations.csv with "resellerLocationID" as NULL

      [gsingh@optus-qa-smb1 data]$ tail -3 business_locations.csv

      22777,"WA3391","Dayton","Dayton","deprecated","locality","WA605551_504031057","AU-WA",0.00090335,0,1,1

      22778,"WA3392","Dayton","Dayton","active","locality","WA605551_504031057","AU-WA",0.00090335,0,1,1

      22779,"","resellerblank","Dayton

      3.Ran

      mysql -u root -ptestvalsvr -hoptus-qa-smb1 mms_common < /home/gsingh/git/core/system/db-structure/smb-services/databases/mms_common/scripts/load_business_location.sql

      4. Check Database

      mysql> select * from mms_common.businessLocationsLoader order by id desc limit 3;

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      id resellerBusinessLocationID description shortDescription status type parentResellerBusinessLocationID budgetEstimateTarget budgetEstimateMultiplier useSEDefinedTargets usePointRadiusTargets isSellable result

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      22779   resellerblank Dayton active locality WA605551_504031058 AU-WA 0.00090335 0 1 1 BL parentResellerBusinessLocationID does not match
      22778 WA3392 Dayton Dayton active locality WA605551_504031057 AU-WA 0.00090335 0 1 1  
      22777 WA3391 Dayton Dayton deprecated locality WA605551_504031057 AU-WA 0.00090335 0 1 1  

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      3 rows in set (0.00 sec)

      mysql> select * from optus.businessLocationIDMap order by systemBusinessLocationID desc limit 5;

      --------------------------------------------+

      businessLocationID systemBusinessLocationID

      --------------------------------------------+

        22779
      WA3392 22778
      WA3391 22777
      WA3390 22776
      WA3389 22775

      --------------------------------------------+

      5 rows in set (0.00 sec)

      5.Send the datafeed service request

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dat="http://www.thesearchagency.com/smb/DataFeedService/">

      <soapenv:Header/>

      <soapenv:Body>

      <dat:executeJobFromFileSystemRepository>

      <!-Optional:->

      <job name="Job 1">

      <!-Optional:->

      <variables>

      <!-Zero or more repetitions:->

      <variable key="START_DATE" value="2012-02-19"/>

      <variable key="END_DATE" value="2012-02-29"/>

      </variables>

      </job>

      </dat:executeJobFromFileSystemRepository>

      </soapenv:Body>

      </soapenv:Envelope>

      Response:

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

      <soap:Body>

      <soap:Fault>

      <faultcode>soap:Server</faultcode>

      <faultstring>There were errors during Job execution.</faultstring>

      </soap:Fault>

      </soap:Body>

      </soap:Envelope>

      And Jboss log shows :

      :05:13,909 INFO [STDOUT] ERROR 02-03 05:05:13,908 - Table output - org.pentaho.di.core.exception.KettleDatabaseBatchException:

      Error updating batch

      Column 'businessLocationID' cannot be null

      at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1494)

      at org.pentaho.di.trans.steps.tableoutput.TableOutput.dispose(TableOutput.java:647)

      at org.pentaho.di.trans.step.RunThread.run(RunThread.java:69)

      at java.lang.Thread.run(Thread.java:662)

      Caused by: java.sql.BatchUpdateException: Column 'businessLocationID' cannot be null

      at com.mysql.jdbc.ServerPreparedStatement.executeBatchSerially(ServerPreparedStatement.java:796)

      at com.mysql.jdbc.PreparedStatement.executeBatch(PreparedStatement.java:1449)

      at org.pentaho.di.core.database.Database.emptyAndCommit(Database.java:1477)

      ... 3 more

      05:05:13,910 INFO [STDOUT] ERROR 02-03 05:05:13,910 - StageDataFromCustomDatabase - Errors detected!

      05:05:13,910 INFO [STDOUT] ERROR 02-03 05:05:13,910 - StageDataFromCustomDatabase - Errors detected!

      05:05:13,913 INFO [STDOUT] INFO 02-03 05:05:13,912 - PDI - Connection to database closed!

      05:05:13,913 INFO [STDOUT] INFO 02-03 05:05:13,913 - Table output - Finished processing (I=0, O=22000, R=22355, W=22000, U=0, E=1)

      Expected: Can we restrict NULL entry here to table "optus.businessLocationIDMap" ?

        Attachments

          Activity

            People

            • Assignee:
              rgardner Ross Gardner
              Reporter:
              atul.sanagar Atul Sanagar (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: