Investigate occassional duplicate key integrity violation on SolarIn

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major
    • Component/s: SolarIn
    • None

      Looking through the SolarIn logs, I noticed there are sometimes duplicate key violations, e.g.

      solarnetwork 91504 2012-10-28 07:02:38 NZDT ERROR:  duplicate key value violates unique constraint "power_datum_node_unq"
      solarnetwork 91504 2012-10-28 07:02:38 NZDT DETAIL:  Key (created, node_id, source_id)=(2012-10-28 07:01:00.015+13, 9, ) already exists.
      solarnetwork 91504 2012-10-28 07:02:38 NZDT STATEMENT:        INSERT INTO solarnet.sn_power_datum     (id    ,created        , node_id,         price_loc_id, watts, bat_volts,    bat_amp_hrs, watt_hour)   VALUES    ($1    ,$2        , $3,         $4, $5, $6,    $7, $8)  
      

      I thought this shouldn't happen as the code queries for existing records before attempting to insert/update. Need to investigate what's causing this, and possibly change the entire insert/update logic.

            Assignee:
            Matt Magoffin
            Reporter:
            Matt Magoffin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: