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 102560 - Generated code does not work with m-n relationships
Summary: Generated code does not work with m-n relationships
Status: VERIFIED WORKSFORME
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Nam Nguyen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-26 01:53 UTC by Peter Liu
Modified: 2008-01-19 15:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch file for the fixes (10.24 KB, patch)
2007-04-26 02:38 UTC, Peter Liu
Details | Diff
sample app (33.01 KB, application/octet-stream)
2007-08-06 21:19 UTC, Lukas Jungmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Liu 2007-04-26 01:53:37 UTC
The generated resource beans and converters do not handle m-n relationships
properly and resulting application will break.

This is a showstopper issue because the j1 demo music database contains
association tables for m-n relationships.
Comment 1 Peter Liu 2007-04-26 02:38:39 UTC
Created attachment 41682 [details]
Patch file for the fixes
Comment 2 Nam Nguyen 2007-04-26 07:37:04 UTC
The attached patch has been reviewed to be limited and safe.
It is also tested to be working properly.
Please go ahead with integration.
Comment 3 Peter Liu 2007-04-26 17:29:30 UTC
Fixes checked into both release60-m9 branch and trunk.
Comment 4 Lukas Jungmann 2007-08-06 21:17:27 UTC
I'm currently unable to verify this, because of an issue with attached app

-unzip attached app and open it in the IDE
-invoke Test Rest... action on the project
-invoke Test WS action on the web service in the project and invoke the ws operation through the WS Tester application
in GlassFish (just to create some dummy entries in tables)
-invoke GET on some resource in the RESTbeans test app

=> fails with sth like:

java.lang.IllegalStateException: 
Exception Description: Cannot use an EntityTransaction while using JTA.
        at
oracle.toplink.essentials.internal.ejb.cmp3.transaction.JTATransactionWrapper.getTransaction(JTATransactionWrapper.java:66)
        at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.getTransaction(EntityManagerImpl.java:340)
        at service.PersistenceService.rollbackTx(PersistenceService.java:157)
        at service.PersistenceService.close(PersistenceService.java:169)
        at service.AddressResource.getJson(AddressResource.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Comment 5 Lukas Jungmann 2007-08-06 21:19:36 UTC
Created attachment 46231 [details]
sample app
Comment 6 Nam Nguyen 2007-08-27 18:37:25 UTC
Closed as work-for-me for now because I verify this bug working fine with GlassFish build 57-rc.
Please reopen if still reproducible with new detailed data about specific Glassfish build and new current web app project.
Comment 7 Lukas Jungmann 2008-01-19 15:44:32 UTC
v.