nsmcp::UnifiedAccessAnalytics method initializeSource (protected)

 <instance of nsmcp::UnifiedAccessAnalytics[i]> initializeSource

Defined in /usr/local/ns/tcl/nsmcp/log-traffic-unified.tcl

Testcases:
No testcase defined.
Source code:
set init [:accessRecordStoreOpen ${:settings}]
if {![$init available]} {
    $init close
    return -code error -errorcode {NSMCP RECORD_STORE pool-busy} "access store initialization pool unavailable"
}
set db [$init session]
try {
    set source [$db scalar {SELECT coalesce((SELECT value FROM nsmcp_records.state WHERE key='sourcePath'),'')}]
    if {$source ne {} && $source ne ${:path}} {
        error "access store belongs to another configured source; use a separate record directory"
    }
    set path ${:path}
    $db execute {INSERT OR IGNORE INTO nsmcp_records.state(key,value) VALUES('sourcePath',:path)}
} finally {
    $init close
}
set :sourceReady true
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: