I have this script that instantiates two different classes for use.

我有这个脚本实例化两个不同的类供使用。

If I lock the tables that they need to read/write to from the "parent" script, would the class instances be able to use the locked tables?

如果我从“父”脚本锁定他们需要读/写的表,那么类实例是否能够使用锁定的表?

I have the suspicion that because they share the same db connection they will be able to do so and that the lock will be held until the "parent" script releases it.

我怀疑,因为他们共享相同的数据库连接,他们将能够这样做,并且锁将被保持,直到“父”脚本释放它。

Am I correct?

我对么?

1 个解决方案

#1


2

Included scripts become a part of the script which includes them, just as if you copied the code from the included script and pasted it into the main one. There is no parent/child separation.

包含的脚本成为包含它们的脚本的一部分,就像您从包含的脚本中复制代码并将其粘贴到主脚本中一样。没有父/子分离。

Consequently, you will be able to access your tables via the included script as long as you are using the same database connection.

因此,只要您使用相同的数据库连接,就可以通过包含的脚本访问表。

更多相关文章

  1. thinkphp框架里怎么用linux的crontab写php的定时脚本
  2. 确定脚本所在的服务器以及PHP中的配置的最佳方法是什么?
  3. imagecreatetruecolor()在symfony中不起作用,但如果作为php脚本运行
  4. php-fpm通过request_slowlog_timeout检查哪个脚本执行时间长
  5. 显示长期运行的PHP脚本的进展。
  6. PHP基础之脚本传参
  7. phpBB3导入帖子的Python脚本
  8. PHP脚本在我的Wordpress文件中。请解码或帮助我删除它。
  9. AJAX调用在JavaScript中运行PHP脚本

随机推荐

  1. pandas_profiling :教你一行代码生成数据
  2. 知乎关注达1万,总阅读破百万,记录与分享带
  3. 50题matplotlib从入门到精通
  4. 神器 | JupyterLab,极其强大的下一代noteb
  5. VS2019学生版的下载安装并使用
  6. java 读取 application配置文件
  7. Centos8基础,Yum软件包管理
  8. 知乎千赞回答 | 为什么自学python看不进
  9. 一不小心,我爬取了100万条微博评论
  10. 15款好用到爆炸的Jupyter Lab插件