switch_mutex_lock(profile->ireg_mutex);
- sprintf(sqlbuf + len, "begin;\n");
- len += 7;
+
+ sprintf(sqlbuf, "begin;\n");
+ sofia_glue_actually_execute_sql(profile, sqlbuf, NULL);
while (switch_queue_trypop(profile->sql_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
char *sql = (char *) pop;
free(pop);
}
- sprintf(sqlbuf + len, "commit;\n");
-
//printf("TRANS:\n%s\n", sqlbuf);
sofia_glue_actually_execute_sql(profile, sqlbuf, NULL);
+
+ sprintf(sqlbuf, "commit;\n");
+ sofia_glue_actually_execute_sql(profile, sqlbuf, NULL);
+
+
switch_mutex_unlock(profile->ireg_mutex);
loop_count = 0;
}