Remove excess statement prepares in loops
diff --git a/listener.go b/listener.go index 25b3d9f..749160f 100644 --- a/listener.go +++ b/listener.go
@@ -109,7 +109,7 @@ log.Error("INSERT APP_CREDENTIAL: i/p args missing") return false } - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( scope, id, appId, @@ -164,7 +164,7 @@ log.Error("INSERT APP: i/p args missing") return false } - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( scope, EntityIdentifier, DeveloperId, @@ -224,7 +224,7 @@ log.Error("INSERT DEVELOPER: i/p args missing") return false } - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( scope, Email, EntityIdentifier, @@ -277,7 +277,7 @@ log.Error("INSERT COMPANY_DEVELOPER: i/p args missing") return false } - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( scope, CompanyId, tenantId, @@ -328,7 +328,7 @@ log.Error("INSERT COMPANY: i/p args missing") return false } - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( scope, EntityIdentifier, tenantId, @@ -377,7 +377,7 @@ log.Error("INSERT API_PRODUCT: i/p args missing") return false } - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( apiProduct, res, env, @@ -428,7 +428,7 @@ * mapping entries associated with the credential */ - _, err = txn.Stmt(prep).Exec( + _, err = prep.Exec( ApiProduct, AppId, EntityIdentifier, @@ -605,7 +605,7 @@ ele.Get("_change_selector", &scope) ele.Get("id", &objid) - res, err := txn.Stmt(prep).Exec(objid, scope) + res, err := prep.Exec(objid, scope) if err == nil { affect, err := res.RowsAffected() if err == nil && affect != 0 { @@ -637,7 +637,7 @@ ele.Get("appcred_id", &EntityIdentifier) ele.Get("_change_selector", &apid_scope) - res, err := txn.Stmt(prep).Exec(ApiProduct, AppId, EntityIdentifier, apid_scope) + res, err := prep.Exec(ApiProduct, AppId, EntityIdentifier, apid_scope) if err == nil { affect, err := res.RowsAffected() if err == nil && affect != 0 { @@ -664,7 +664,7 @@ ele.Get("company_id", &companyId) ele.Get("developer_id", &developerId) - res, err := txn.Stmt(prep).Exec(tenantId, companyId, developerId) + res, err := prep.Exec(tenantId, companyId, developerId) if err == nil { affect, err := res.RowsAffected() if err == nil && affect != 0 {