使用事务时如何处理错误,并且 table 使用 myISAM 引擎而不是 InnoDB?

How can I handle an error when using transactions, and the table is using the myISAM engine instead of InnoDB?

当数据库默认不使用 myISAM 引擎,或者表使用 myISAM 而不是 InnoDB 时,php 中的 beginTransaction 函数不会 return false。

那么,遇到这种情况如何处理错误?

我发现这个 link 我可以在其中查询数据库并查看 table 是 myisam 还是 innodb...但我不知道这是否是最佳解决方案。我必须在每次查询之前检查 table 是 myisam 还是 innodb。 How do I find if my a table is MyISAM or Innodb