You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by pietia <pi...@gmail.com> on 2008/05/04 14:48:28 UTC

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

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

-- 
View this message in context: http://www.nabble.com/Another-way-for-non-jta-data-source-with-derby---%28openjpa%29-tp17045622s134p17045622.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


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

Posted by pietia <pi...@gmail.com>.
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! :)
-- 
View this message in context: http://www.nabble.com/Another-way-for-non-jta-data-source-with-derby---%28openjpa%29-tp17045622s134p17194048.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.