Skip to content

Commit c185385

Browse files
committed
Start default transaction according to INI settings
1 parent fec3f35 commit c185385

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

interbase.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,20 @@ int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans) /* {{{ */
14071407
ib_link->tr_list->trans = tr;
14081408
}
14091409
if (tr->handle == 0) {
1410-
if (isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL)) {
1410+
ISC_STATUS result;
1411+
zend_long trans_argl = IBG(default_trans_params);
1412+
1413+
if(trans_argl == PHP_IBASE_DEFAULT){
1414+
result = isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL);
1415+
} else {
1416+
zend_long trans_timeout = IBG(default_lock_timeout);
1417+
char last_tpb[TPB_MAX_SIZE];
1418+
unsigned short tpb_len = 0;
1419+
_php_ibase_populate_trans(trans_argl, trans_timeout, last_tpb, &tpb_len);
1420+
result = isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, tpb_len, last_tpb);
1421+
}
1422+
1423+
if (result) {
14111424
_php_ibase_error();
14121425
return FAILURE;
14131426
}

0 commit comments

Comments
 (0)