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

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

View: New views
2 Messages — Rating Filter:   Alert me  

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

by pietia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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

by pietia :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello!

That ^^ method doesn't work - lot of troubles with non-jta operations.
The best way is to use own deployment plan.
If somebody will have problems i can post quick fix (small tutorial).

Thanks to djencks! :)