Edit | Attach | New | Raw | Delete | History | Print | Tools

Configuring Apache Derby for XA using Spring Framework

Client Mode

<bean id="myXADatasource" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" 
                                                                           destroy-method="close">
   <property name="uniqueResourceName" value="MYDERBYUNIQUENAME" />
   <property name="xaDataSourceClassName" value="org.apache.derby.jdbc.ClientXADataSource" />
   <property name="xaProperties">
      <props>
         <prop key="databaseName">testDB</prop>
         <prop key="serverName">localhost</prop>
         <prop key="portNumber">1527</prop>
      </props>
   </property>
</bean>

Notes

The Apache Derby ClientXADataSource is part of the derby-client library, which could be found in the Maven2 Repository.

Embedded Mode

<bean id="dynaresumeDataSource" 
class="com.atomikos.jdbc.AtomikosDataSourceBean"
        init-method="init" destroy-method="close">
   <!-- set an arbitrary but unique name for the datasource -->
   <property name="uniqueResourceName" value="myDerbyDB" />

   <property name="xaDataSourceClassName" 
   value="org.apache.derby.jdbc.EmbeddedXADataSource" />
   <property    name="minPoolSize"><value>1</value></property>
   <property    name="maxPoolSize"><value>5</value></property>
   <property name="xaProperties">
   <props>
   <prop key="databaseName">${user.home}/myDerbyDB</prop>

</props>
</property>

</bean>

-- MartinBengl - 23 Feb 2009 spacer

Copyright © 2014 Atomikos BVBA. Transaction Management for Extreme Transaction Processing and SOA Environments serving ISV, Commercial, OEM and Open Source Markets
Site map RSS ATOM