简体   繁体   English

将Joomla表引擎更改为InnoDB

[英]Changing Joomla tables engine to InnoDB

I wrote an application in JAVA that adds articles to a Joomla site. 我用JAVA编写了一个应用程序,可将文章添加到Joomla网站。
My problem is that inserting an article needs five queries to run (adding article to content table, inserting corresponding node to assets table , updating other nodes in assets table & setting asset id for inserted article); 我的问题是在插入的物品需要五个查询来运行(添加物品content表,在插入对应节点到assets表,在更新其他节点assets表&设置资产ID插入文章); and because of that my JAVA application is running on a remote machine lots of problems can make any of these queries fail & if any of them fail the entire assets table breaks. 并且由于我的JAVA应用程序在远程计算机上运行,​​因此很多问题都会使这些查询中的任何一个失败,并且如果其中任何一个失败,整个assets表就会中断。
I thought about using transactions and manual commit to solve this but Joomla's Storage Engine (MyISAM) doesn't support transactions. 我考虑过使用事务和手动提交来解决此问题,但Joomla的存储引擎(MyISAM)不支持事务。 so thought about converting storage engine of those two tables to "InnoDB". 因此考虑将这两个表的存储引擎转换为“ InnoDB”。
Is this correct ? 这个对吗 ? doesn't it rise problems for Joomla(for example in JOINING with other tables that are using MyISAM)? 它是否会给Joomla带来问题(例如,在与其他使用MyISAM的表进行联接时)? Will it affect on site and makes it slower? 它会影响网站并使其变慢吗?
Is there any other solution (eg sending all 5 queries to server to run in sequence)? 还有其他解决方案(例如,将所有5个查询发送到服务器以按顺序运行)吗?

Thanks 谢谢

Some thoughts: 一些想法:

  1. I am not completely sure but I don't think Joomla should have any issues with InnoDB. 我不确定,但我认为Joomla与InnoDB无关。 When joining MyISAM and InnoDB tables in a JOIN, MySQL internally converts InnoDB to MyISAM. 当在JOIN中联接MyISAM和InnoDB表时,MySQL在内部将InnoDB转换为MyISAM。 But I'm not a Joomla guy and I still can't be sure on it 但是我不是Joomla的家伙,我仍然不确定

  2. Why not use triggers - an AFTER INSERT trigger on content ? 为什么不使用触发器-对content进行AFTER INSERT触发器?

  3. You may also write a stored procedure for running all 5 INSERTs but again there will not be any transaction support 您也可以编写一个存储过程来运行所有5个INSERT,但同样不会提供任何事务支持

  4. Create a single table to hold all data from all the 5 INSERT queries. 创建一个表来保存所有5个INSERT查询中的所有数据。 Of course this table is only of an intermittent nature. 当然,该表只是间歇性的。 Now create another stored procedure that will then migrate all data from this intermediate table to the respective tables. 现在创建另一个存储过程,然后将所有数据从该中间表迁移到相应的表。

Hope the above makes sense! 希望以上是合理的!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM