title: Eclipselink is living in the past, DDL not reflecting Entities
body: <p>Weird stuff... I have happily used EclipseLink / JPA 2 as provider for my persistence unit for a while (with a MySQL RDBMS in the back). I had DDL-drop/create turned off, since I wanted to keep records in the DB and there weren't any changes to the Entities anyway.</p>
  
  <p>Now I've just made some bigger changes to one Entity (adding some attributes, renaming / re-typing others, importing a previously embedded object flat into this entity, etc). I turn on DDL-drop/create, re-deploy a couple of times, and ... nothing changes!</p>
  
  <p>EclipseLink actually creates (and re-creates) the SQL Tables based on the <strong>old</strong> information! It's like it has a copy of the Java class somewhere and ignores the one I just updated...</p>
  
  <p>Even more crazy, the previously embedded object is gone. I deleted the class-file. Eclipselink <strong>still</strong> creates the attributes in the table of the previously embedding class.</p>
  
  <p>I see no Exceptions in GlassFish server.log. I dropped and recreated the persistence Unit, no change. Any ideas? (Let me know if I should post any code / log entries, and I'll update this post.) </p>
  
  <p><strong>Update:</strong> After setting <code>eclipselink.logging.level</code> to <code>FINEST</code>, I still see no exceptions. The DDL-script is created (with wrong columns in it) and happily executed on the DB (creating the wrong columns of course). In the logs I see EclipseLink talking about the fields that aren't there anymore:</p>
  
  <pre><code>[#|2010-09-22T17:04:11.392+0200|CONFIG|glassfish3.0.1|org.eclipse.persistence.session.file:/Users/hank/NetBeansProjects/CoreServer/build/classes/_coreServerPersistenceUnit.ejb_or_metadata|_ThreadID=20;_ThreadName=Thread-1;|
  The alias name for the entity class [class mvs.entity.Shopper] is being defaulted to: Shopper.|#]
  
  [#|2010-09-22T17:04:11.392+0200|CONFIG|glassfish3.0.1|org.eclipse.persistence.session.file:/Users/hank/NetBeansProjects/CoreServer/build/classes/_coreServerPersistenceUnit.ejb_or_metadata|_ThreadID=20;_ThreadName=Thread-1;|
  The column name for element [field msisdn] is being defaulted to: MSISDN.|#]
  
  [#|2010-09-22T17:04:11.392+0200|CONFIG|glassfish3.0.1|org.eclipse.persistence.session.file:/Users/hank/NetBeansProjects/CoreServer/build/classes/_coreServerPersistenceUnit.ejb_or_metadata|_ThreadID=20;_ThreadName=Thread-1;|
  The column name for element [field imei] is being defaulted to: IMEI.|#]
  </code></pre>
  
  <p>In this case <code>mvs.entity.Shopper</code> is the class. <code>msisdn</code> is an existing field, but <code>imei</code> does not exist anymore. No idea where EclipseLink is getting the info from...</p>
  
  <p>Btw, I have <code>eclipselink.weaving</code> set to <code>false</code>, since it was causing issues with lazy-loading. Could this be related?</p>
  
  <p><strong>Update 2:</strong> Following Gordon's advice I have looked for old copies of the entity, but couldn't find any. Deploying the appliation on a fresh GlassFish did <em>not</em> show the behaviour from above; instead the mapping was done <em>correctly</em> as was DDL-creation! Yippie :)</p>
  
  <p>My only conclusion is that the old copy must be kept somewhere in GlassFish, even after undeploying... Does that make sense?</p>