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.

Bug 199650 - Copying project results in stale persistence.xml
Summary: Copying project results in stale persistence.xml
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-23 10:51 UTC by alexismp
Modified: 2016-07-07 08:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample project which needs to be copied to reproduce (17.51 KB, application/zip)
2011-06-23 10:52 UTC, alexismp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alexismp 2011-06-23 10:51:25 UTC
(NetBeans 201106180600)

- create a web project
- add an entity, say Employee
- generate the persistence.xml
- select drop&create strategy
- create a @Singleton/@Startup bean grabbing the EntityManager and persisting a couple of Employee
- deploy application
- observe the creation of tables and the data being added

- make a copy of the project (right-click > copy project)
- edit the persistence.xml to remove the drop&create strategy
- deploy the application
- this triggers errors showing this new application tries to drop&create tables, probably showing that the old persistence.xml is used by this new application

Got SQLException executing statement "CREATE TABLE CUSTOMER..."
- doing a "Clean and Build" followed by a "Deploy" fixes the problem

There is some stale project metadata somewhere...
Comment 1 alexismp 2011-06-23 10:52:22 UTC
Created attachment 109078 [details]
Sample project which needs to be copied to reproduce
Comment 2 Martin Janicek 2014-01-27 10:52:09 UTC
Sounds like a persistence hint issue --> reassigning to Persistence for evaluation
Comment 3 Martin Balin 2016-07-07 08:54:46 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss