Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default transaction Read-Commited RecVersion NoWait (more useful parameters than server defaults) #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion interbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,9 @@ PHP_FUNCTION(ibase_trans)

int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans) /* {{{ */
{
unsigned short tpb_len = 0;
char last_tpb[TPB_MAX_SIZE];

if (ib_link == NULL) {
php_error_docref(NULL, E_WARNING, "Invalid database link");
return FAILURE;
Expand All @@ -1295,7 +1298,14 @@ 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)) {
tpb_len = 0;
last_tpb[tpb_len++] = isc_tpb_version3;
last_tpb[tpb_len++] = isc_tpb_write;
last_tpb[tpb_len++] = isc_tpb_read_committed;
last_tpb[tpb_len++] = isc_tpb_rec_version;
last_tpb[tpb_len++] = isc_tpb_nowait;

if (isc_start_transaction(IB_STATUS, &tr->handle, 1, &ib_link->handle, tpb_len, last_tpb)) {
_php_ibase_error();
return FAILURE;
}
Expand Down