Jump to: navigation, search

Difference between revisions of "Gemini/JPA/Documentation/Integrations"

m (Integrations)
(Integrations)
Line 5: Line 5:
 
==== JDBC ====
 
==== JDBC ====
  
Gemini JPA is integrated with the OSGi JDBC spec. In fact, the use of Gemini DBAccess to access a JDBC datasource is highly recommended. See the [[Documentation:CreatingAnApplication#Using_Gemini_DBAccess | Using Gemini DBAccess]] section.
+
Gemini JPA is integrated with the OSGi JDBC spec. In fact, the use of Gemini DBAccess to access a JDBC datasource is highly recommended. See the [[Gemini/JPA/Documentation/CreatingAnApplication#Using_Gemini_DBAccess | Using Gemini DBAccess]] section.
  
 
==== JNDI ====
 
==== JNDI ====
  
Coming Soon.
+
Gemini JPA can do a JNDI lookup to find an existing data source if an entry is supplied in the '''non-jta-data-source''' element in the persistence.xml descriptor. If the data source is available in the OSGi service registry and an OSGi JNDI provider is active then the OSGi JNDI syntax can be used to specify it. For example, the following entry could be present in the persistence descriptor:
 +
 
 +
<source lang="xml">
 +
<persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL">
 +
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
 +
        <non-jta-data-source>osgi:service/myDS</non-jta-data-source>
 +
        ...
 +
</persistence-unit>
 +
</source>
 +
 
 +
Note that this data source is not a JTA data source.
  
 
==== Configuration Admin ====
 
==== Configuration Admin ====
  
See [[OtherTopics#Configuration_Admin]] section.
+
See the [[Gemini/JPA/Documentation/OtherTopics#Configuration_Admin | Configuration Admin]] section for details on how to use Config Admin with Gemini JPA.

Revision as of 12:22, 19 June 2013

Integrations

There are a number of integrations with other components that make Gemini JPA play well with others.

JDBC

Gemini JPA is integrated with the OSGi JDBC spec. In fact, the use of Gemini DBAccess to access a JDBC datasource is highly recommended. See the Using Gemini DBAccess section.

JNDI

Gemini JPA can do a JNDI lookup to find an existing data source if an entry is supplied in the non-jta-data-source element in the persistence.xml descriptor. If the data source is available in the OSGi service registry and an OSGi JNDI provider is active then the OSGi JNDI syntax can be used to specify it. For example, the following entry could be present in the persistence descriptor:

<persistence-unit name="MyPU" transaction-type="RESOURCE_LOCAL">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <non-jta-data-source>osgi:service/myDS</non-jta-data-source>
        ...
</persistence-unit>

Note that this data source is not a JTA data source.

Configuration Admin

See the Configuration Admin section for details on how to use Config Admin with Gemini JPA.