0
votes

I used the following command to deploy updates of my *.ear file on Glassfish 3/4 and to keep (but disable) the old version of the *.ear file:

./asadmin --user admin deploy --name MyProject:0.9.2 --createtables=false --dropandcreatetables=false --enabled=true --force=true /home/updates/MyProject.ear

This always worked without touching the database. I have applied database changes manually by a script.

But suddenly this does not work anymore. The application deploys correctly, but the database is being dropped and newly created...

My Glassfish version is currently 4.0/b89. Does anybody know if there's a bug in with the asadmin deploy command ? Any other ideas how to deploy without dropping the database?

EDIT1: Btw: I'm using Eclipse-Link 2.4 as JPA-provider (if this helps...)

EDIT2: I now tried every possible combination (using only --createtables=false OR --dropandcreatetables=false), but nothing seems to work. The database is dropped everytime. I realized, that if the table-creation-strategy is set to "none" in the persistence.xml, it does work for subsequent deployments (without dropping the database). But the asadmin/deploy or also redeploy command should override the persistence.xml settings as described here and here when the --dropandcreatetables option is set to false.

1
Just checking (I'm no expert), but don't you want redeploy, not deploy?iaindownie
I want to keep the old version on the server (disabled). So I could easily switch back, if anything goes wrong during the update process. With "redeploy", the old version is overwritten. Moreover, the --name option incl. verison-identifier does not work with "redeploy"; it says that MyProject:0.9.3 is not deployed, since the currently deployed predecessor version is named MyProject:0.9.2. These tools are some kind of buggy ...salocinx

1 Answers

1
votes

According to

asadmin help deploy

and

asadmin help redeploy

for 4.0/b89, you should only use one of these? Indicated by the | in the help.

"The --createtables and --dropandcreatetables options are mutually exclusive; only one should be used."

Iain