Skip to content

Commit

Permalink
Start default transaction according to INI settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mlazdans committed Mar 4, 2025
1 parent fec3f35 commit c185385
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion interbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,20 @@ int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans) /* {{{ */
ib_link->tr_list->trans = tr;
}
if (tr->handle == 0) {
if (isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL)) {
ISC_STATUS result;
zend_long trans_argl = IBG(default_trans_params);

if(trans_argl == PHP_IBASE_DEFAULT){
result = isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, 0, NULL);
} else {
zend_long trans_timeout = IBG(default_lock_timeout);
char last_tpb[TPB_MAX_SIZE];
unsigned short tpb_len = 0;
_php_ibase_populate_trans(trans_argl, trans_timeout, last_tpb, &tpb_len);
result = isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, tpb_len, last_tpb);
}

if (result) {
_php_ibase_error();
return FAILURE;
}
Expand Down

0 comments on commit c185385

Please sign in to comment.