0

how to manage the transactions in wso2esb or wso2dss we have option to create a datasource in wso2esb.While i am creating external datasource with xadatasource but its unable to create its giving issue i created with below configuration

Data Source Type*=RDBMS
Name*=USCProduction
Data Source Provider*=External Data Source
Data Source Class Name*=org.postgresql.xa.PGXADataSource
Data Source Properties
====================
url=jdbc:postgresql://localhost:5432/USCProduction
user=admin
password=admin

bbut its unable to create giving error like this

ERROR: Error in creating external data source: org.postgresql.xa.PGXADataSource



ERROR - DataSourceRepository Error in creating external data source: org.postgresql.xa.PGXADataSource
org.wso2.carbon.ndatasource.common.DataSourceException: Error in creating external data source: org.postgresql.xa.PGXADataSource
    at org.wso2.carbon.ndatasource.rdbms.utils.RDBMSDataSourceUtils.handleExternalDataSource(RDBMSDataSourceUtils.java:323)
    at org.wso2.carbon.ndatasource.rdbms.utils.RDBMSDataSourceUtils.createPoolConfiguration(RDBMSDataSourceUtils.java:283)
    at org.wso2.carbon.ndatasource.rdbms.RDBMSDataSource.<init>(RDBMSDataSource.java:42)
    at org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader.createDataSource(RDBMSDataSourceReader.java:58)
    at org.wso2.carbon.ndatasource.core.DataSourceRepository.createDataSourceObject(DataSourceRepository.java:202)
    at org.wso2.carbon.ndatasource.core.DataSourceRepository.registerDataSource(DataSourceRepository.java:359)
    at org.wso2.carbon.ndatasource.core.DataSourceRepository.addDataSource(DataSourceRepository.java:473)
    at org.wso2.carbon.ndatasource.core.services.NDataSourceAdminService.addDataSource(NDataSourceAdminService.java:78)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)

how we can do this and try with this also copied this into datasources file

<datasource>
            <name>sample</name>
  <xa-datasource jndi-name="java:jboss/PostgresXADS" pool-name="PostgresXADS">
    <driver>postgresql</driver>
    <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
    <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
    <xa-datasource-property name="DatabaseName">USCProduction</xa-datasource-property>
    <security>
      <user-name>admin</user-name>
      <password>admin</password>
    </security>
    <validation>
      <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker">
      </valid-connection-checker>
      <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter">
      </exception-sorter>
    </validation>
  </xa-datasource>
  <drivers>
    <driver name="postgresql" module="org.postgresql">
      <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
    </driver>
  </drivers>
</datasource>

how can i create xa datasource in wso2esb to use transaction mediator

Community
  • 1
  • 1
Faisal
  • 1,469
  • 2
  • 13
  • 25

1 Answers1

0

You need to add the PostgreSQL JDBC Driver to ESB_HOME/repository/components/lib, and restart the server.

Kasun Gajasinghe
  • 2,735
  • 1
  • 21
  • 30
  • i already added that in lib even its giving errors postgresql-9.0-801.jdbc4.jar file even giving errors – Faisal Jan 24 '14 at 09:45
  • @faisal.shaik What are the errors you are seeing with the postgresql jar? I've been using postgresql-9.3-1100.jdbc4.jar without any problems. – Kasun Gajasinghe Jan 25 '14 at 18:57
  • thanx for reply i am using 9.1 postgres and added jar postgresql-9.0-801.jdbc4 this is working for default datasource not for xa datasource have you done any transaction example please go through this links http://stackoverflow.com/questions/21228546/wso2esb-transaction-for-local-database http://stackoverflow.com/questions/21135505/wso2dss-box-carring-not-working-in-wso2esb4-8-0 – Faisal Jan 27 '14 at 05:16