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.