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.
dev build 200810261401 When I open persistence.xml Netbeans writes "retrieving datasources". It also complains when one of my project's old datasources goes missing. It's not clear to me: 1) How to view all the datasources associated with my project and remove them. 2) How to get the Persistence Units dialog in the persistence.xml editor to offer me a list of JDBC sources instead of datasources. I somehow got JDBC sources listed in the past but the behavior seems somewhat random. Sometimes I see JDBC sources, sometimes datasources, and I'm not sure what I'm doing to trigger one or the other.
It seems that in order to get the dialog box to display JDBC sources you need to: 1) Go into XML editing mode 2) delete <non-jta-data-source> 3) Define the following properties: eclipselink.jdbc.driver eclipselink.jdbc.url eclipselink.jdbc.user eclipselink.jdbc.password 4) Go back into Design mode. The dialog should now display "JDBC Connection" instead of "Datasource". I am expecting to be able to transition between Datasouce to JDBC and back using the GUI.
It seems the steps I listed are not enough. I *still* can't figure out how to get the GUI to ask for a JDBC source. Any ideas?
Got it! There seem to be two bugs. 1) It turns out that if you configured Glassfish as your server in Project Properties then even creating a "New Persistence Unit" won't offer you JDBC connections. But if you switch to Tomcat suddenly the option shows up. Netbeans should offer the use of JDBC connections even if you're using Glassfish. For one, they make JUnit testing a heck of a lot easier! 2) If you're editing persistence.xml by hand you will never be offered the option of JDBC connections unless you first go into Services -> Databases -> New Connection, and create a new JDBC connection. Once that's done you must follow the steps I mentioned below: - Go into XML editing mode - delete <non-jta-data-source> - Define the following properties: eclipselink.jdbc.driver eclipselink.jdbc.url eclipselink.jdbc.user eclipselink.jdbc.password Then once you return to Design Mode jdbc will show up. Please fix this. It was extremely frustrating to track down :(
Reassigning...
mostly there are no issues, what kind of sources is presented is based on project server properties, transaction type, availability of registred datasources and jdbc sources. for 2, you don't need jdbc connections in most cases, you can always create new datasource based on required connection. I don't see a reason to do what you're trying to do in general, what for you need to select jdbc connection in wizard instead of datasource? for 1st, some resouces may be defined on server side and you may need to change server configuration, some may be in sun-resources.xml if you use glassfish. it may be good to have some management for these resources in gui, especially a way to remove one if ide complains about something. it's some kind of usabuility issue may be consider as enhancment request also.
sergeyp, I want my main codebase and JUnit tests to use the same connection type. As far as I know, there is no easy way to use datasource connections from JUnit.
ok, it looks like a task to allow RESOURCE_LOCAL type of transactions (in persistence unit) be created even in container based projects. yet it's more like functionality limitation instead of a defect.
recently I got a problem with deployment of local transaction to a server(may be it was jboss), so it may not be possible for some servers to use this trnsaction types, also I see it now more like enhancement (if it's possible) as unit tests are executed locally and do not have container management unit tests must use local tarnsactions type but server should use jta trnsactions if it's possible, and even may check and do not allow other types, in general configurations should be different.
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