Community
Participate
Working Groups
It would be interesting a new feature, where Gemini JPA allows integration with Gemini Naming project, so the persistance descriptors could get the datasource object throught JNDI, using the following tag for example: <non-jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/XXX)</non-jta-data-source> There is a comment in the Gemini Forum: http://www.eclipse.org/forums/index.php/t/242860/
Please make sure that setting <jta-data-source></...> is at least not prevented. At the moment you have to track EMFBuilderS to appear, re-parse persistence.xml, set jta and non-jta datasources and create the EMF by hand which is tedious. I am actually not sure if the non-jta datasource is required at all if a jta datasource is set. The solution to this problem would be a real timesaver...
This is a really good feature to have.
I will put some support in for this, but only in the context of non-JTA at this point. Will go further to support JTA data sources once I get to enhancement 356508 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=356508)
I think the presence of a non-jta-data-source element in persistence.xml will override JDBC properties if they exist. If anybody feels like this should not be the case then speak up now.
Added for M1.
I have downloaded the M1 release it works, but if the data source is registered after the gemini jpa bundle started, it does not recognize the the data source and EMF is not registered. After a restart of the gemini jpa bundle it works. Means if data source is registered before jemini jpa bundle start, it works. This would be great if we get rid of this start order..
It's not possible to track the JNDI entry in the cases when the JNDI lookup is in a traditional JNDI environment, i.e. not a dynamic service. My understanding of what people wanted was to use it in some kind of a container environment, and in these kinds of environments the application is deployed into the container, so the datasource would already have been registered in JNDI. What is the environment that you are using it in, and why would the JNDI entry not exist when Gemini JPA processes the application?
I am using it in equinox OSGI only where the datasource object is an OSGI service. This service is registered by a datasource bundle(depends on dbaccess bundle) when the CM bundle is started as it consumes configuration. So there is enough possibility that the jpa bundle starts before datasource bundle. Aries jpa manages it well, but I dont use it as it require openjpa.
If you are in an environment where DBAccess is running then why don't you just use that? Why are you using JNDI at all?
I have entered bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=411279 to describe the data source tracking issue. Please add any comments to that bug. Thanks.