title: Unable to use multiple ebean databases in Play 2
body: <p>We are setting up a slightly complicated project using Play Framework 2.0.3.</p>
  
  <p>We need to access several databases (pre-existing) and would like to do it using the frameworks built-in facilities (ie. EBean).</p>
  
  <p>We tried to create all model classes within the "models" package, and then map each class with its FQN to the corresponding EBean property in the application.conf:</p>
  
  <pre><code>ebean.firstDB="models.ClassA,models.ClassB,models.ClassC"
  ebean.secondDB="models.ClassD"
  ebean.thirdDB="models.ClassE,models.ClassF"
  </code></pre>
  
  <p>This doesn't seem to work:</p>
  
  <pre><code>PersistenceException: Error with [models.SomeClass] It has not been enhanced but it's superClass [class play.db.ebean.Model] is? (You are not allowed to mix enhancement in a single inheritance hierarchy) marker[play.db.ebean.Model] className[models.SomeClass] 
  </code></pre>
  
  <p>We checked and re-checked and the configuration is OK!</p>
  
  <p>We then tried to use a different Java package for each database model classes and map them accordingly in the application.conf:</p>
  
  <pre><code>ebean.firstDB = "packageA.*"
  ebean.secondDB = "packageB.*"
  ebean.thirdDB = "packageC.*"
  </code></pre>
  
  <p>This works fine when reading information from the database, but when you try to save/update objects we get:</p>
  
  <pre><code>PersistenceException: The default EbeanServer has not been defined? This is normally set via the ebean.datasource.default property. Otherwise it should be registered programatically via registerServer()
  </code></pre>
  
  <p>Any ideas? </p>
  
  <p>Thanks!
  Ricardo</p>