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.
Summary: | use entity manager should generate EntityManagerFactory attribute | ||
---|---|---|---|
Product: | javaee | Reporter: | catweasle <catweasle> |
Component: | Persistence | Assignee: | Sergey Petrov <sj-nb> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.4 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
catweasle
2014-02-10 16:09:09 UTC
yes, it's not the best approach, but static field isn't good too, in my opinion, and anyway lifecycle of EntityManager isn't handled and depends on user requirenment and is likely will require more work. this methd is more like a draft user can rely on. moreover "several invocation", I see no much reason to support it better as all methds do the same if I got it right. Fair enough, if you don't like the EntityManagerFactory to be static, make it non static, at least it would survive over different persist(Object o) calls. I do not have a problem with EntityManager being created for each persist. Several invocations example: persist(new User("John","Deer")); Persist(new Car("Firebird","V6"); ... 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 |