geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Tedeev <ted_...@hotmail.com>
Subject Re: Problem with persistence.xml (how to use data source?)
Date Sun, 30 Mar 2008 19:16:22 GMT

Worked for me (at least application deploys)

WEB-INF/persistence.xml ---------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="equipment-pu">
   
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
    <jta-data-source>jdbc-jta-ds</jta-data-source>
        <non-jta-data-source>jdbc-non-jta-ds</non-jta-data-source>
    <!-- ssi.api.jpa.company -->
    <class>ssi.api.jpa.company.Description</class>
    <class>ssi.api.jpa.company.Equipment</class>
    <class>ssi.api.jpa.company.EquipmentMaintanence</class>
    <class>ssi.api.jpa.company.EquipmentMaintanenceType</class>
    <class>ssi.api.jpa.company.EquipmentType</class>
    <properties>
      <property name="openjpa.Log" value="DefaultLevel=TRACE, Tool=TRACE,
SQL=INFO"/>
      <property name="openjpa.jdbc.DBDictionary"
value="ssi.api.jpa.AS400Dictionary"/>
    </properties>
  </persistence-unit>
</persistence>


Then in geronimo-web.xml I have these references :

<nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>jdbc-jta-ds</nam:ref-name>
        <nam:resource-link>jdbc-jta-AAF</nam:resource-link>
</nam:resource-ref>

<nam:resource-ref xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2">
        <nam:ref-name>jdbc-non-jta-ds</nam:ref-name>
        <nam:resource-link>jdbc-non-jta-AAF</nam:resource-link>
</nam:resource-ref> 

-- 
View this message in context: http://www.nabble.com/Problem-with-persistence.xml-%28how-to-use-data-source-%29-tp16380414s134p16385985.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message