Class SyncLogDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.inventoru.sync1c.dao.SyncLogDAO

public class SyncLogDAO extends CommonDAO
DAO for inventoru_sync1c_import_log.
  • Constructor Details

  • Method Details

    • insertImportLog

      public void insertImportLog(ImportLog log) throws SQLException
      Creates a new import log record with status=running; sets id on the object.
      Throws:
      SQLException
    • finishImportLog

      public void finishImportLog(ImportLog log) throws SQLException
      Updates finished_at, items_synced, status, error_text on an existing log record.
      Throws:
      SQLException
    • countRecentConsecutiveImportErrors

      public int countRecentConsecutiveImportErrors(int instanceId, int limit) throws SQLException
      Counts the streak of most recent finished import log records of the instance that ended in 'error' — the streak breaks on the first non-error record. Note: the unit is a log RECORD (one per engineer-warehouse mapping per poller run), not a poller cycle — with several mappings a single cycle against a dead 1C produces several error records at once. Used by ImportPoller to alarm on a persistently unreachable/broken instance, mirroring ExportPoller.alarmIfExhausted.
      Throws:
      SQLException
    • getImportLog

      public List<ImportLog> getImportLog(int instanceId, int limit) throws SQLException
      Throws:
      SQLException