Currently TopLink's ddlGeneration mode is different when running with
createEntityManagerFactory than it is for createContinerEntityManagerFactory.
DEFAULT_DDL_GENERATION_MODE = DDL_SQL_SCRIPT_GENERATION
This default mode was set in the early days of the GlassFish integration before
the createContainerEntityManagerFactory(PersistenceUnitInfo info, Map
properties) had a map of properties available.
When running with createEntityManagerFactory() we override the default by
setting an inSEMode flag and when running in SE mode, we effectively use:
We need to remove the inSEMode flag and always use the setting provided to
We should also change the default to: DDL_DATABASE_GENERATION since this will
allow most users to work by default.
In order for GlassFish DDL generation to continue to work, GlassFish will have
to pass the toplink.ddl-generation.output-mode=sql-script to the properties map
provided in createContainerEntityManagerFactory(). A separate bug will be
filed for that issue and it will be linked to this one.