Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Distributed Transaction in Standalone Application

  1. #11

    Default

    Hello,

    I tried to do the same some time ago and I noticed I have to specify user/pass in both the innerDS and the Pool:

    Code:
    <bean id="jotm"
    		class="org.springframework.transaction.jta.JotmFactoryBean" />
    
    	<bean id="transactionManager"
    		class="org.springframework.transaction.jta.JtaTransactionManager">
    		<property name="userTransaction" ref="jotm" />
    	</bean>
    
    	<bean id="oracleDataSource"
    		class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"
    		destroy-method="shutdown">
    		<property name="dataSource" ref="innerOracleDataSource" />
    		<property name="minSize" value="2" />
    		<property name="maxSize" value="5" />
    		<property name="user" value="${username}" />
    		<property name="password" value="${password}" />
    
    	</bean>
    
    	<bean id="innerOracleDataSource"
    		class="org.enhydra.jdbc.standard.StandardXADataSource"
    		destroy-method="shutdown">
    		<property name="transactionManager" ref="jotm" />
    		<property name="driverName" value="${jdbcDriverClass}" />
    		<property name="url" value="${jdbcUrl}" />
    		<property name="user" value="${username}" />
    		<property name="password" value="${password}" />
    	</bean>
    Perhaps this will solve your problem...

    -Patrick

  2. #12
    Join Date
    Jan 2007
    Posts
    1

    Default config example

    Hi,
    I´m trying to use spring + ibatis in a jta transaction. I got some doubts about the spring config file (dao config + datasource etc). Does anyone can send a spring config example?

    tks!

  3. #13
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    See the petclinic/jpetstore example from the main Spring distribution. They indicate how to properly configure the datasource and ibatis. For configuring the datasource against the JTA manager you have to look at the TM documentation.
    Beside JOTM (you can find several examples on this forum also) I recommend you look at Atomikos which has recently been open-sourced.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  4. #14
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Quote Originally Posted by koalalam View Post
    Hi,

    I am developing a standalone Java application using Oracle. In order to have distributed transaction, I looked up a JTA transaction manager from WebLogic server and bind the data source to it. ...
    Do you use separate connect for each participating database or you connect to a single database and access other participating databases over DBLinks
    from database to which you connect?

    In latter case you need not to mess-up with JTA transaction manager, XA datasources etc.

    Use any datasource of your choice (pooled or unpooled, depending on your application needs) and plain DataSourceTransactionManager. Oracle will deal with distribution transactions absolutely transparently for you.

    Regards,
    Oleksandr

  5. #15

    Default

    Did you ever find a way to do standalone application that requires distributed transaction ? We have a similar requirement and are trying to use jta from weblogic server but having problems.

  6. #16
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    Quote Originally Posted by samitadassarkar View Post
    Did you ever find a way to do standalone application that requires distributed transaction ? We have a similar requirement and are trying to use jta from weblogic server but having problems.

    I do not know of any generic way, but most major databases have their own means for handling distributed transaction in such a way that application even has no need to knoow that transaction are distributed.

    So if you have several DBs of the same type (Oracle, DB2, ...) then you should be able (with the help of your DBA) to achieve this goal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •