Atomic operations with nontransactional engines (MyISAM)
(INFO: this text is a supplement/clarification to http://www.doctrine-project.org/jira/browse/DDC-2905)
I know, MyISAM tables are nontransactional. That does not mean, that atomic operations are not possible.
The question is how does the ORM system deal with the problem. I think its a database abstraction layer too. That means the ORM can see that the engine MyISAM is nontransactional and it chooses a different strategy to solve this task.
It makes no sense to send commands how „"SET TRANSACTION" to a nontransactional MyISAM engine (it will not work) and Doctrine ORM do that.
(for more details see my example for this behavior:
(the user- and address-tables are both MyISAM-Tables)
Only the user and the first address are stored in the db, but the developer can not see that. An atomic operation is canceled (I think $em->flush() is an implicit atomic operation), we get an exception but the ORM does not go back to the original state. Now we have a system in a inconsistent state and no information about which entities are stored and which are not. Is this an expected behavior of a ORM system or database abstraction layer? I hope not.
I would now to check all entities if they are stored. In this simple example that is no problem, but for large object-graphs is this a big problem.
(sorry for my english - I try my best