学说回滚问题

时间:2011-09-01 02:34:28

标签: symfony1 doctrine symfony-1.4 virtuemart

我有一个奇怪的现象。我将数据库表添加到架构中,这些架构已经存在于数据库连接'virtuemart'中。但他无法连接到这个表格。

我用

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

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

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

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

但始终是错误消息

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

我检查了架构,但我找不到任何错误:

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 }

有什么想法吗?

我希望我提供了足够的信息。如果不是,请不要犹豫,并要求它。

1 个答案:

答案 0 :(得分:2)

代码看起来不错,但架构没有。

  1. vendor_idtax_statetax_countrymdatetax_rate之后的冒号怎么样?他们失踪了。

  2. scale(4)错了。 scale: 4是正确的。