title: Doctrine2: Type x already exists
body: <p>I have a problem with the Doctrine API.</p>
  
  <p>I want to add a new Doctrine Type. I followed this documentation to create the class, and I have added the type in my custom driver.</p>
  
  <pre><code>Type::addType("custom", "Namespace\NameBundle\Types\CustomType");
  $this-&gt;registerDoctrineTypeMapping("CustomType", "custom");
  </code></pre>
  
  <p>My problem append when I execute php app/console cache:clear.</p>
  
  <pre><code>[Doctrine\DBAL\DBALException]
  Type custom already exists.
  </code></pre>
  
  <p>After few searches, I have found in Doctrine\DBAL\Types\Type::addType(…) throw an exception if the type is knew… I don't understand why this error is throwing.</p>