]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_odbc_transaction: correctly initialise forcecommit value from DSN.
authorJaco Kroon <jaco@uls.co.za>
Tue, 23 Feb 2021 11:28:08 +0000 (13:28 +0200)
committerGeorge Joseph <gjoseph@digium.com>
Thu, 25 Feb 2021 14:45:49 +0000 (08:45 -0600)
Also improve the in-process documentation to clarify that the value is
initialised from the DSN and not default false, but that the DSN's value
is default false if unset.

ASTERISK-29311 #close

Change-Id: I46e2379f7b0656034442bce77cb37ccd4e61098d
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
res/res_odbc_transaction.c

index dd6ee30e5e343d4e1e1b3ea7f7edbf42fe276283..31615577dce3a722b17cdc8ea76fb5345059a7b1 100644 (file)
@@ -44,7 +44,8 @@
                                        </enum>
                                        <enum name="forcecommit">
                                                <para>Controls whether a transaction will be automatically committed when the channel
-                                               hangs up.  Defaults to false.  If a <replaceable>transaction ID</replaceable> is specified in the optional argument,
+                                               hangs up.  Defaults to forcecommit value from the relevant DSN (which defaults to false).
+                                               If a <replaceable>transaction ID</replaceable> is specified in the optional argument,
                                                the property will be applied to that ID, otherwise to the current active ID.</para>
                                        </enum>
                                        <enum name="isolation">
@@ -175,7 +176,7 @@ static struct odbc_txn_frame *create_transaction(struct ast_channel *chan, const
                return NULL;
        }
        txn->isolation = ast_odbc_class_get_isolation(txn->obj->parent);
-       txn->forcecommit = ast_odbc_class_get_isolation(txn->obj->parent);
+       txn->forcecommit = ast_odbc_class_get_forcecommit(txn->obj->parent);
        txn->active = 1;
 
        if (SQLSetConnectAttr(txn->obj->con, SQL_ATTR_AUTOCOMMIT, (void *)SQL_AUTOCOMMIT_OFF, 0) == SQL_ERROR) {