Search code examples
symfony1doctrinesymfony-1.4virtuemart

Doctrine Rollback Issue


I have a weird phenomenom. I added database tables to the schema which are already existing in the database the connect 'virtuemart'. But he can't connect to this tables.

I tried it with

    $taxId = Doctrine::getTable('JosVmTaxRate')
        ->findOneBy('tr.tax_country', 'NZL');

and

    $taxId = Doctrine::getTable('JosVmTaxRate')
        ->findBy('tr.tax_country', 'NZL');

and

    $taxId = Doctrine::getTable('JosVmTaxRate')
        ->findOneBy('tr.tax_country', '"NZL"');

and

    $taxId = Doctrine::getTable('JosVmTaxRate')
        ->createQuery('tr')
        ->addWhere('tr.tax_country =?', 'NZL')
        ->execute()
        ->get(0);

but always the error message

500 | Internal Server Error | Doctrine_Transaction_Exception 
Rollback failed. There is no active transaction.

appears.

I checked the schema but I can't find any fault in there:

JosVmTaxRate:
  columns:
    tax_rate_id:                    { type: int, notnull: true, unique: true, primary: true, autoincrement: true }
    vendor_id                       { type: int, default: null }
    tax_state                       { type: string(64), default: null }
    tax_country                     { type: string(64), default: null }
    mdate                           { type: int, default: null }
    tax_rate                        { type: decimal(10), scale(4), default: null }

Any idea?

I hope I provided enough information. If not don't hesitate and ask for it.


Solution

  • The code looks alright for me, but the schema not.

    1. What about the colons after vendor_id, tax_state, tax_country, mdate and tax_rate? They are missing.

    2. scale(4) is wrong. scale: 4 is correct.