[Asterisk-code-review] res_odbc_transaction: correctly initialise forcecommit value from DSN. (asterisk[16])

Jaco Kroon asteriskteam at digium.com
Tue Feb 23 14:52:58 CST 2021


Jaco Kroon has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15511 )


Change subject: res_odbc_transaction: correctly initialise forcecommit value from DSN.
......................................................................

res_odbc_transaction: correctly initialise forcecommit value from DSN.

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 at uls.co.za>
---
M res/res_odbc_transaction.c
1 file changed, 3 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/11/15511/1

diff --git a/res/res_odbc_transaction.c b/res/res_odbc_transaction.c
index dd6ee30..3161557 100644
--- a/res/res_odbc_transaction.c
+++ b/res/res_odbc_transaction.c
@@ -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 @@
 		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) {

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15511
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I46e2379f7b0656034442bce77cb37ccd4e61098d
Gerrit-Change-Number: 15511
Gerrit-PatchSet: 1
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210223/5543f5bf/attachment.html>


More information about the asterisk-code-review mailing list