thinkphp 事务 回滚
发表于|更新于|thinkphp
开启事务
1 | Db::startTrans(); |
事务回滚
1 | Db::rollback(); |
提交事务
1 | Db::commit(); |
一旦commit就无法回滚了
文章作者: developer
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!
相关推荐
2018-01-15
thinkphp 5.0.10 模型 自动 时间戳 bug
当模型中同时启用 12protected $autoWriteTimestamp = true;protected $field = ['bill_type', 'create_time']; 必须将create_time放入$field中,才可以操作,否则时间戳写入失败
2019-03-04
thinkphp beego swoft yaf 性能测试 压力测试 php go swoole 速度对比 helloworld
1ab -n 10000 -c 200 测试机为腾讯云1核1G普通云硬盘,如果用ssd的话php成绩会有所提升 输出内容为时间戳 beego swoft的性能都强的不得了,在同一级别,裸跑性能都逼近nginx处理静态文件nginx转发损耗很大,由于nginx转发会导致thinkphp,swoft,beego的性能几乎一样。所以有可能的话还是不要在这些框架外套个nginx了swoft+nginx:内存无波动,CPU占用81%swoft无nginx:内存无波动,CPU占用34% thinkphp+nginx41212345678910111213141516171819202122232425262728Concurrency Level: 200Time taken for tests: 24.256 secondsComplete requests: 10000Failed requests: 0Total transferred: 1940000 bytesHTML transferred: 190000 by...
2018-01-31
Supervisor 配置 使用 常见问题 thinkphp 队列 使用方法
安装安装方法很多,这里给出最简便的 123wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py -O - | sudo pythoneasy_install supervisor 然后 1find / -name supervisord.conf 找到supervisord.conf路径 1echo_supervisord_conf > /etc/supervisord.conf 在找到的空配置中生成示例配置 详细方法http://blog.csdn.net/xyang81/article/details/51555473 配置最后一行 123;包含其它配置文件[include]files = relative/directory/*.ini ;可以指定一个或多个以.ini结束的配置文件 这里注意!!!*[include]*前的 ; 要去掉,否则不会加载 ini 配置!!! 使用在你inclue的目录中加一个ini 1234567891011[program:thinkphp]command...
2018-09-18
thinkphp 连接 pgsql postgresql 报错 table_msg
原文地址http://www.thinkphp.cn/topic/42766.html 注意端口 数据库等 pgsql中没有table_msg这个函数需要自己到库中定义,如下所示pgsql postgresql中没有 这个 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117CREATE OR REPLACE FUNCTION pgsql_type(a_type varchar) RETURNS varchar AS $BODY$ DECLARE v_type varchar; BEGIN IF a_type='...
2017-01-02
ci laravel lumen slim symfony thinkphp thinkphp5 yii2 phalcon yaf php框架安装后裸跑速度对比
最近比较忙先这样用吧 都是用我的笔记本 Wamp2.5 php5.6 apache2.4.9下跑的环境一致 绝对速度可能没有参考价值,相对速度可以参考,装上换上一样的模板就跑 模板地址 http://www.iguojin.com/ 1<div class="keywords">WE PROVIDE H5 GAMES & WECHAT DEVELOPMENT</div> 跑三遍。。。CI还是很猛的。。我觉得小项目是时候从TP转到CI了 2017-09-06最新测试phalcon可能是小项目首选,原因主要是, 这个框架速度极快, 使用简单,基本上和thinkphp用起来一样方便,没有一些强制性和框架专属的东西,很人性化 他的文档我看了一下只有一个,比较详细,没有藏着掖着的东西,这点算是优于thinkphp和laravel 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// y...
2019-03-03
thinkphp beego swoft yaf 性能测试 压力测试 php go swoole 速度对比 数据读取
1ab -n 10000 -c 200 统一使用ab在200并发进行10000次请求 为更接近实际使用,用各自模型读取了一条数据 测试机为腾讯云1核1G普通云硬盘,如果用ssd的话php成绩会有所提升 用nginx做转发,会限制golang性能发挥,压测nginx静态页面大概2157qps 首先需要说明,swoft和beego在裸跑时,效率爆棚,几乎逼近处理静态文件,速度是thinkphp的6-7倍.增加nginx后有了较大耗损,差不多是thinkphp的1.7倍.受制于nginx和fpm,yaf这种框架也只是比thinkphp提升了一丢丢,实际意义已经不大 thinkphp+nginx253大部分请求都比较慢,但是基本上是0.8S左右 12345678910111213141516171819202122232425262728Concurrency Level: 200Time taken for tests: 39.601 secondsComplete requests: 10000Failed requests: 0Tota...
公告
This is my Blog