更改了 php-interbase 默认事务行为
我有一些运行很长时间(24 小时以上)的 PHP CLI 脚本,尽管它们定期“提交”,但我在孤立事务方面遇到了一些问题 - 可能是由脚本崩溃引起的。
我的解决方案是创建事务如下 - 一年前我研究了这个,不太记得这些设置的确切原因,但它似乎解决了数据库的一些问题。
$dbh = ibase_connect($dbhost, $dbuser, $dbpass); $trans = ibase_trans(IBASE_WRITE+IBASE_COMMITTED+IBASE_REC_VERSION+IBASE_WAIT,$dbh);
现在已升级到 php 5.3.5,发现 ibase_trans 行导致分段错误。 php ibase_trans 页面上有一条注释:
“该函数的行为在 PHP 5.0.0 中已更改。第一次调用 ibase_trans() 将不会返回连接的默认事务。”
所以我的问题是我是否可以为默认交易设置交易参数...第二个问题,我是否完全错过了尝试这样做的要点!
谢谢
I have some PHP CLI scripts that run for a long time (24 hours plus) and although they do regular 'commit's I had some problems with orphaned transactions - possibly caused by scripts crashing out.
My solution was to create the transaction as follows - it was a year ago that I researched this and can't quite remember the precise reasons for these settings but it seemed to solve some problems with the database.
$dbh = ibase_connect($dbhost, $dbuser, $dbpass);
$trans = ibase_trans(IBASE_WRITE+IBASE_COMMITTED+IBASE_REC_VERSION+IBASE_WAIT,$dbh);
Have now upgraded to php 5.3.5 and found that the ibase_trans line causes a segmentation fault. On the php ibase_trans page there is a note:
"The behaviour of this function has been changed in PHP 5.0.0. The first call to ibase_trans() will not return the default transaction of a connection."
So my question is whether I can set the transaction arguments for the default transaction... Secondary question, whether I am entirely missing the point in trying to do this anyway!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应该使用默认事务。
定义您的事务如下:
运行查询后:
或者您可以使用 ibase_prepare & ibase_execute。
之后,请致电
或
You should not work with default transaction.
Define your transaction as folows:
After run your query:
or you may use ibase_prepare & ibase_execute.
After it, call
or