#1061: Transactions handled differently in Postgres/MySQL using Column 
Aggregation
Inheritance
---------------------------+------------------------------------------------
  Reporter:  georgec       |       Owner:                       
      Type:  defect        |      Status:  new                  
  Priority:  minor         |   Milestone:  1.0.4                
 Component:  Transactions  |     Version:  1.0.2                
Resolution:                |    Keywords:                       
  Has_test:  0             |    Mystatus:  Pending User Response
 Has_patch:  0             |  
---------------------------+------------------------------------------------
Changes (by guilhermeblanco):

  * mystatus:  Pending Core Response => Pending User Response

Old description:

> I'm using Column Aggregation Inheritance, with a number of classes
> inheriting from a parent called m2f_element.
>
> When calling Doctrine::createTablesFromModels(), Doctrine will run the
> Doctrine_Export::exportClasses() method. As a number of classes inherit
> from m2f_element, Doctrine tries to run the corresponding number of
> "CREATE TABLE m2f_element" queries.
>
> The try()...catch() block in this method is designed to silently ignore
> any errors equivalent to Doctrine::ERR_ALREADY_EXISTS, so that the
> repeated CREATE TABLE queries are ignored.
>
> This works well in MySQL. However, in PostgreSQL, the first CREATE TABLE
> query will succeed, the second will fail with "Duplicate table: 7 ERROR:
> relation "m2f_element" already exists" as expected, but the third query
> fails with "SQLSTATE[25P02]: In failed sql transaction: 7 ERROR:  current
> transaction is aborted, commands ignored until end of transaction block".
> I can replicate this exact behaviour when I run the queries manually in
> PostgreSQL: Every query following a failed query is ignored.
>
> This means the outcome of the table creation routine for Column
> Aggregation Inheritance is different for MySQL and PostgreSQL.

New description:

 I'm using Column Aggregation Inheritance, with a number of classes
 inheriting from a parent called m2f_element.

 When calling Doctrine::createTablesFromModels(), Doctrine will run the
 Doctrine_Export::exportClasses() method. As a number of classes inherit
 from m2f_element, Doctrine tries to run the corresponding number of
 "CREATE TABLE m2f_element" queries.

 The try()...catch() block in this method is designed to silently ignore
 any errors equivalent to Doctrine::ERR_ALREADY_EXISTS, so that the
 repeated CREATE TABLE queries are ignored.

 This works well in MySQL. However, in PostgreSQL, the first CREATE TABLE
 query will succeed, the second will fail with "Duplicate table: 7 ERROR:
 relation "m2f_element" already exists" as expected, but the third query
 fails with "SQLSTATE[25P02]: In failed sql transaction: 7 ERROR:  current
 transaction is aborted, commands ignored until end of transaction block".
 I can replicate this exact behaviour when I run the queries manually in
 PostgreSQL: Every query following a failed query is ignored.

 This means the outcome of the table creation routine for Column
 Aggregation Inheritance is different for MySQL and PostgreSQL.

Comment:

 Does this issue still persist?

 georgec, can you confirm if this issue are still present in 1.0/1.1?

 Regards,

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1061#comment:8>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to