Apache Geronimo > Discussion Forums  User List | Dev List | Wiki | Issue Tracker  

 « Return to Thread: Another way for non-jta-data-source with derby ? (openjpa)

Another way for non-jta-data-source with derby ? (openjpa)

by pietia :: Rate this Message:

Reply to Author | View in Thread

hello,
I dont know - if it's important but i found that in openjpa docs:


When using a managed DataSource, you should also configure a second unmanaged DataSource that OpenJPA can use to perform tasks that are independent of the global transaction. The most common of these tasks is updating the sequence table OpenJPA uses to generate unique primary key values for your datastore identity objects. Configure the second DataSource using the non-jta-data-source  persistence.xml element, or OpenJPA's various "2" connection properties, such as openjpa.ConnectionFactory2Name  or openjpa.Connection2DriverName. These properties are outlined in Chapter 2,  Configuration .

<!-- managed DataSource -->
<jta-data-source>java:/OracleXASource</jta-data-source>
<properties>
    <!-- use OpenJPA's built-in DataSource for unmanaged connections -->
    <property name="openjpa.Connection2UserName" value="scott"/>
    <property name="openjpa.Connection2Password" value="tiger"/>
    <property name="openjpa.Connection2URL" value="jdbc:oracle:thin:@CROM:1521:OpenJPADB"/>
    <property name="openjpa.Connection2DriverName" value="oracle.jdbc.driver.OracleDriver"/>
</properties>

I have tested it with Geronimo 2.1.1 and basic appliation -  and i think it should works instead of
defining new dbpool (non-jta) in web console.

Pietia

 « Return to Thread: Another way for non-jta-data-source with derby ? (openjpa)

LightInTheBox - Buy quality products at wholesale price