persistence@glassfish.java.net

Re: Safe DDL generation with injection

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Thu, 06 Dec 2007 14:17:07 -0800

Hi Klaus,

If you use asadmin deploy with --dropandcreatetables it works in GlassFish the
same way as the "drop-and-create-table" property. I.e. if it's the first deploy
(vs. a redeploy), no attempt will happen to drop the tables.

However if you need to drop them because e.g. you recreated the domain without
undeploying the app, just redeploy your app again (without even running), and
the process will drop the existing tables (as long as they match the tables that
were supposed to be created on the last deploy).

HTH,
-marina

Klaus Unger wrote:
> Hi,
>
> sorry but I have a few questions about this left:
>
> During development I am using Eclipse to deploy/redeploy my ear project. Is
> there a way to redeploy it via asadmin without knowing an ear/dir path (just
> like it is possible to via the web admin console).
>
> The description "If true, and if tables were not automatically created when
> this application was last deployed, no attempt is made to drop any tables."
> lets me doubt that --dropandcreatetables will work in combination with
> eclipse usually doing the deployment. Is it really behaving different than
> the "drop-and-create-table" property?
>
> - Klaus
>
> On Thursday 29 November 2007 22:54:49 Marina Vatkina wrote:
>
>>Hi Klaus,
>>
>>In GlassFish there is an option to drop and create tables for the Toplink
>>Essentials as the JPA provider at application deploy (and drop tables on
>>undeploy) time. See GlassFish developer guide for the details:
>>http://docs.sun.com/app/docs/doc/819-3672/gbwlh?a=view
>>
>>Regards,
>>-marina