This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Hi, I found that when I run or debug my project the setting in persistence.xml when set to drop-and-create has no effect. The tables are not dropped. The only way to get it working correctly is to undeploy-deploy the project. Or to exit Netbeans and restart it again. In NB60 this works perfectly. So the scenario is: - Start NB61 - Run application - Tables are dropped and created - Stop GF - Run application - Tables are not dropped Alternatively: - Start NB61 - Run application - Tables are dropped and created - Undeploy-deploy the application - Tables are not dropped This behavior is found in GF v2, v2-ur1 and v2-ur2. Iwan
Does the clean&build of the project help?
No, only an undeploy/deploy seems to help. I verified this in NB61RC2. In NB60 it works all the time. Iwan
I guess that this behavior is related to enabled directory deployments. I tested to disable this option in RC2 and everything works as expected, e.g. when you just run app then tables are dropped/created. Please, try to righ-click server node in service tab and invoke Properties -> Options tab and uncheck 'Directory deployment' option.
When disabling the directory deployment option as suggested, it does in fact work, and the tables are dropped and recreated. Please note that in NB60 directory deployment is enabled and it still works. I tried this procedure with both NB60 and NB61RC1 and NB61RC2 for GFv2, GFv2ur1 and GFv2ur2. Iwan
Not caused by the persistence support per se. I can't tell when the server recreates the EntityManagerFactory for the persistence unit (which I suppose triggers the drop and create), so reassigning to the plugin.
I added code that would avoid calling for deployment processing on Run if the app's java code is unchanged... this allows folks to have faster Run-> edit jsp-> Run response times. I guess that was too aggressive. Andrei: Is there an API that will tell me if the drop-and-create element is present in the persistence.xml of a module?
Here is what i have found... i registered gf i created the webjpa sample project which became the main project... i started the db i started the server i used the Run Main Project item in the Run menu to run the webjpa project the tables were created i added data to the table through the interface that webjpa provides i verified that the data was in the table. I stopped the server i used the Run Main Project item in the Run menu to run the project (which restarts the server) i saw that there was still data in the table I used the Undeploy and Deploy item on the project's right click menu I verified that the tables were empty That seems like it is doing what we would expect.... Run doesn't always mean deploy. Undeploy and deploy appears to force the web app to be redeployed, even if the redeployment is not strictly necessary. I am going to close this as worksforme.