FirebirdSQL / php-firebird

Firebird PHP driver
Other
66 stars 15 forks source link

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

Open safhome opened 3 years ago

mrotteveel commented 3 years ago

This is a rather big and breaking change, I would recommend against it.

safhome commented 3 years ago

Default "wait" flag is unusable in real web apps because of many parallel requests. Trying to serialize it with "wait" transactions results in fatal performance degradation. Considering that we haven't settings for default transaction's flags, current defaults make unusable almost all existing CMS with Firebird. With this change we successfully use Joomla! versions from 3.1 upto 3.9 for last 5 years with Firebird as main database for it.

MartinKoeditz commented 3 years ago

Well, I think it's better to implement some kind of function or parameter where we can set as default. Maybe via ini settings. In that case you can specify your custom behaviour without breaking other software.

mrotteveel commented 3 years ago

@safhome It may work for you, but that is not the issue. This changes default behaviour that has been in use for years (decades), and it is relied upon by other applications that could break due to this change (in some cases in hard to notice ways). You are changing the isolation level from concurrency (aka snapshot) to read_committed, which has different visibility rules. And changing wait to nowait could break applications that rely on wait for their correct behaviour.

mlazdans commented 2 years ago

Configuring default transaction parameters would be great feature and much appreciated.