Distributed Transaction with EJB 3.0 / JPA

I did some testing here and it proved to work. I would like someone to tell me if this is really true.
I have many Stateless Session Bean and Entity Beans, using EJB 3.0 with JPA. The Persistence Unit is configured using JTA transaction type. Some of them are deployed in different app server instances.
Consider an EJB "A" executing EJBs "B" and "C", both in different containers (remote).
Both B and C use EntityManager to save data into the database.
Let�s say "A"�s method doit() first execute "B" succesfully and when executing "C", it fails. Will the whole transaction be rolledback?
The scenarios I tried it proved to work. But I want a second opinion.
Thanks
ps: I was using OracelAS/OC4J

yes, that is how transactions are supposed to work across app servers. granted, that is assuming that the secondary methods are all using the "REQUIRED" (the default if unspecified) or "SUPPORTS" transaction types. you can change this by using some of the other transaction types, depending on what relationship you want between the various methods.

Similar Messages

  • Get error from SQL AGENT: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024

    I am running SQL Agent that executes an SSIS process from sql server1. The SSIS process executes its SQL/tables/sp’s  against another sql server2.
    I get an error after adding data flow tasks with transaction supported within a sequence with transaction required. The error, “The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D024 "The transaction
    manager has disabled its support for remote/network transactions"
    Prior to adding this sequence everything was working from sql agent, and there were other sequences with oledb destinations.
    Everything works when running within SSIS Package.
    I see this article on similar issue,
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0bfa2569-8849-4884-8f68-8edf98a9b4fe/problem-to-execute-a-package-and-tasks-with-a-certain-transactionoption-property-i-need-help?forum=sqlintegrationservices
    “I had similar issue and solved by setting the following on both the machines. Allow Remote Clients, Allow Remote Administration,
    Allow Inbound Clients, Allow Outbound Clients, and TIP are enabled in Component Services/My Computer/Properties/MSDTC/Security Configuration.”
    I don’t want to remove transaction required for the “Remove Duplicates from Staging” sequence.
    Anyone seen this?
    Greg Hanson

    DTC was running on remote computer. The problem was it was no longer accepting transactions from remote servers. This was in SSIS so I had to turn to "Transaction Supported" for all Data Flow Transactions.
    Greg Hanson

  • Bean-managed transaction with EJB 3.0

    Hi,
    I try to get a bean-managed transaction example running with EJB 3.0 under GlassFish v2ur2.
    In order to demarcate the scenario I have to get me the UserTransaction which I get from the SessionContext. I would like to use it then like: UserTransaction ut = context.getUserTransaction();
    I tried to get the SessionContext with the help of the EJB method setSessionContext which should be called by the container after instance creation.
    However, setting a log output into that method does not show any call of this method.
    So, how can I get this method called or is there another way to get the SessionContext for the UserTransaction to work ?
    Are there any good and fully implemented examples for bean-managed transactions ?
    Thanks for your help.
    Regards

    I found the solution for that my SessionContext was NULL and I could not use the UserTransaction.
    The reason for it is that I injected the EJB with @EJB into my servlet and did a MyBean mybean = new MyBean();
    That leads to a SessionContext which is NULL within my EJB.
    If I use it without instantiating it it works fine.
    Again, thanks for your help. At least it pointed me into the right direction.
    Regards

  • Using Distributed Transaction with oracle 9i and VB

    How to I get distributed transaction to work between a COM + object in VB and oracle using MSDAORA.1 driver? I keep getting the following error:
    error number:
    -2147168229
    error description:
    Cannot connect to the transaction manager or the transaction manager is unavailable.

    Oracle 9i works great with VB.NET. I would recommend you to use Oracle Data Provider .NET (ODP.NET) as a database driver
    http://otn.oracle.com/tech/windows/odpnet/content.html
    for better performance and get full advantage of Oracle 9i features.
    Regards
    Jagriti
    OTN Team @IDC

  • Distributed transactions with container-managed MDBs

              I have built a framework that employs a high rate of code reuse while abstracting
              the complexities of inter-application communication. This allows application
              developers to focus on solving their business needs and not worry about "the plumbing"
              between the applications.
              At this point, the framework is using container-managed MDBs for Topic destinations.
              MDBs were chosen because of their concurrent nature for processing JMS messages.
              Now that I have this framework up and running, I am trying to add distributed
              transaction support and am having trouble understanding what I need to do. Here
              is how the framework works:
              The MDB will recieve a message, unmarshall it into a business object, and then
              route that object to the appropriate business class where it is then processed
              accordingly. In most cases, the processing of this message object will require
              database interaction. If any error should occur while processing the message,
              all XAResources within the transaction should rollback and ultimately, the JMS
              message will be redelivered later.
              Here is what I'm trying to find out:
              1. When control is passed to an application and it gets a DB connection, will
              that DB resource be dynamically enlisted with the transaction?
              2. Must the DB connection come from the WLS DB pool to be enlisted with the transaction?
              I ask this because the current standard at this company is to use a home-grown
              DB connection pool for getting DB connections. This is due to the fact that not
              all applications here run in a WLS environment and they wanted a standard way
              of retrieving a DB connection across applications. They also sited problems with
              WLS 4.5.1 connection pool.
              3. The documentation states that only one database may be involved in a transaction.
              If a connection to another database is required, but not needed in the current
              transaction, will WLS ignore enlisting the 2nd DB resource, or throw an exception?
              4. Where can I find <B>detailed</B> information about this subject? Everything
              that I have read so far has barely scratched the surface for this specific topic.
              Thanks,
              Bob.
              

              Hi Bob,
              If you are using WLS's XA connection pool, then the XAResource associated with
              the XA connections are enlisted with the transaction transparently for you. Enlistments
              actually occur not at getConnection, but on demand when the JDBC objects are actually
              used.
              If you are not using WLS connection pools, then you would need to enlist the XAResource
              associated with the XA connections yourself. You can obtain the transaction associated
              with the current thread by calling weblogic.transaction.TxHelper.getTransaction(),
              and then call enlistResource on the transaction.
              Weblogic has provisions that allow one (and only one) non-XA connection pool to
              participate in a distributed transaction. In this case, you will get a SQLException
              when you try to obtain a connection from a second connection pool in the same
              distributed transaction. However, if you are using real XA connection pools,
              there is no limitation and any number of XA connection pools can participate in
              the same distributed transaction.
              We will try to incorporate more info in our online docs in the future.
              -- Priscilla Fung, BEA Systems, Inc.
              "Bob Peroutka" <[email protected]> wrote:
              >
              >I have built a framework that employs a high rate of code reuse while
              >abstracting
              >the complexities of inter-application communication. This allows application
              >developers to focus on solving their business needs and not worry about
              >"the plumbing"
              >between the applications.
              >
              >At this point, the framework is using container-managed MDBs for Topic
              >destinations.
              > MDBs were chosen because of their concurrent nature for processing JMS
              >messages.
              >
              >Now that I have this framework up and running, I am trying to add distributed
              >transaction support and am having trouble understanding what I need to
              >do. Here
              >is how the framework works:
              >
              >The MDB will recieve a message, unmarshall it into a business object,
              >and then
              >route that object to the appropriate business class where it is then
              >processed
              >accordingly. In most cases, the processing of this message object will
              >require
              >database interaction. If any error should occur while processing the
              >message,
              >all XAResources within the transaction should rollback and ultimately,
              >the JMS
              >message will be redelivered later.
              >
              >Here is what I'm trying to find out:
              >
              >1. When control is passed to an application and it gets a DB connection,
              >will
              >that DB resource be dynamically enlisted with the transaction?
              >
              >2. Must the DB connection come from the WLS DB pool to be enlisted with
              >the transaction?
              >
              >I ask this because the current standard at this company is to use a home-grown
              >DB connection pool for getting DB connections. This is due to the fact
              >that not
              >all applications here run in a WLS environment and they wanted a standard
              >way
              >of retrieving a DB connection across applications. They also sited problems
              >with
              >WLS 4.5.1 connection pool.
              >
              >3. The documentation states that only one database may be involved in
              >a transaction.
              > If a connection to another database is required, but not needed in the
              >current
              >transaction, will WLS ignore enlisting the 2nd DB resource, or throw
              >an exception?
              >
              >4. Where can I find <B>detailed</B> information about this subject?
              > Everything
              >that I have read so far has barely scratched the surface for this specific
              >topic.
              >
              >Thanks,
              >
              >Bob.
              

  • Distributed Transaction with MSSQServer7.0

    Hi,
              I'm trying to implement Distributed transaction using inet optima driver(XA
              compliant driver based on JDBC2.0) with MSSQL7.0 in weblogic6.0
              environment.I'm getting the following error.
              XA error: XAER_RMERR : A resource manager error has occured in the
              transaction branch start() failed on resource 'metadata' Internal error
              during start for XAResource 'metadata'
              Any help on fixing this is greatly appreciated.
              Thank You
              Kannan
              

              Hi Kannan,
              Did the XA connection pool start up successfully? (e.g. did you see messages like "<Connection for XA pool "xxx" created.>" in the server log?) Could you describe briefly what you are doing, and post the full stack trace and any relevant code snippet, config.xml etc?
              -- Priscilla Fung, BEA Systems, Inc.
              "kannan" <[email protected]> wrote:
              >Hi,
              >
              >I'm trying to implement Distributed transaction using inet optima driver(XA
              >compliant driver based on JDBC2.0) with MSSQL7.0 in weblogic6.0
              >environment.I'm getting the following error.
              >
              >XA error: XAER_RMERR : A resource manager error has occured in the
              >transaction branch start() failed on resource 'metadata' Internal error
              >during start for XAResource 'metadata'
              >
              >Any help on fixing this is greatly appreciated.
              >
              >Thank You
              >
              >Kannan
              >
              >
              >
              

  • Error in Distributed transactions with tx data source

              Hi, I need to write into two DB2 databases using two container managed entity beans
              from a container managed session bean. I use a JDBC 3.0 compatible JDBC driver
              and I have configured tx data source. When I run the session bean it gives me
              following exception.
              java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException:
              EJB Exception:; nested exception is: java.sql.SQLException: Connection has already
              been created in this tx context for pool named DB2ConnectionPool2. Illegal attempt
              to create connection from another pool: DB2ConnectionPool1
              thank you Lahiru
              

              For a connection pool with xa-drivers, create a tx datasource and select 'Honor
              Global Transactions'. For a connection pool with non-xa drivers, create a tx datasource,
              select 'Honor Global transactions', and select 'Enable Two-phase commit'.
              "Lahiru Karunatilake" <[email protected]> wrote:
              >
              >Hi, I need to write into two DB2 databases using two container managed
              >entity beans
              >from a container managed session bean. I use a JDBC 3.0 compatible JDBC
              >driver
              >and I have configured tx data source. When I run the session bean it
              >gives me
              >following exception.
              >
              >java.rmi.RemoteException: EJB Exception: ; nested exception is: javax.ejb.EJBException:
              >EJB Exception:; nested exception is: java.sql.SQLException: Connection
              >has already
              >been created in this tx context for pool named DB2ConnectionPool2. Illegal
              >attempt
              >to create connection from another pool: DB2ConnectionPool1
              >
              >thank you Lahiru
              >
              

  • Problem in Distributed transaction with Oracle 8.1.7 and Weblogic 7.0

              Hi,
              I am using two unmanaged weblogic 7.0 servers and oracle 8.1.7 enterprise edition.
              I am using oracle.jdbc.xa.client.OracleXADataSource for creating connection pool
              in weblogic. The pool gets created fine but when connection it is getting used
              it throws up following error.
              java.sql.SQLException: ORA-02044: transaction manager login denied: transaction
              in progress
              ORA-06512: at "SYS.JAVA_XA", line 0
              ORA-06512: at line 1
              at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
              at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
              at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
              at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
              at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:822)
              at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
              at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
              at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
              at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
              at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:171)
              at weblogic.jdbc.jta.VendorXAResource.start(VendorXAResource.java:41)
              at weblogic.jdbc.jta.DataSource.start(DataSource.java:569)
              I don't know what is causing this problem.Please send me the pointers.
              Regards,
              Vikash
              

    ID is a NUMBER and id.toString() is not a number, for
    example it ca be a null reference.
    well we tryed also this version :
    ps.setLong(1, id.longValue());
    moreover the exception wasn't thrown for the value of id :56 but was thrown for the value of id : 88. Hence I think it is a case of something other than my code.
    michal

  • Does Oracle 8.1.5 with weblogic 6.1 sp2 suppports Distributed Transactions ---A really night Mare

              Which version of jdbc thin driver should i use to achieve distributed transaction
              with oracle 8.1.5 in weblogic 6.1 sp2
              right now if iam using the driver classes provided in weblogic.jar iam gettig the
              following Exception
              AccountBean.ejbCreate( id = accountId, initial balance = $ 3000.0)
              java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured
              in the transaction branch start(
              ) failed on resource 'OracleXAPool' Unexpected error during start for XAResource
              'OracleXAPool': null
              at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1044)
              at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1010)
              at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:148)
              at weblogic.jdbc.jta.Connection.prepareStatement(Connection.java:226)
              at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
              at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
              at examples.ejb.basic.beanManaged.AccountBean.ejbCreate(Unknown Source)
              at examples.ejb.basic.beanManaged.AccountBean_g1748h_Impl.ejbCreate(AccountBean_g1748h_Impl.java:172)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.ejb20.manager.DBManager.create(DBManager.java:492)
              at weblogic.ejb20.manager.DBManager.remoteCreate(DBManager.java:462)
              at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:190)
              at examples.ejb.basic.beanManaged.AccountBean_g1748h_HomeImpl.create(AccountBean_g1748h_HomeImpl.java:76)
              at examples.ejb.basic.beanManaged.AccountBean_g1748h_HomeImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
              at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
              at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:158)
              at weblogic.rmi.internal.ServerRequest.sendOneWayRaw(ServerRequest.java:92)
              at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:112)
              at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:253)
              at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:220)
              at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
              at $Proxy126.create(Unknown Source)
              at examples.wtc.atmi.simpapp.ToupperBean.putMessage(ToupperBean.java:194)
              at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl.putMessage(ToupperBean_8roqg7_EOImpl.java:284)
              at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Regards
              Ranga Rao
              

              Oracle Server 8.1.5 does not provide support for 2PC.
              Full XA support is provided from version 8.1.7.
              Sergi
              "Lawrence" <[email protected]> wrote:
              >
              >Ranga,
              >Please use classes12.zip for this.If you still find problem, please let
              >me know.
              >Thanks
              >Lawrence
              >
              >"Ranga Rao" <[email protected]> wrote:
              >>
              >>
              >>Which version of jdbc thin driver should i use to achieve distributed transaction
              >>with oracle 8.1.5 in weblogic 6.1 sp2
              >>
              >>right now if iam using the driver classes provided in weblogic.jar iam
              >gettig
              >>the
              >>following Exception
              >>
              >>////////////////////////////////////////////////////////////////////////////////////////////
              >>AccountBean.ejbCreate( id = accountId, initial balance = $ 3000.0)
              >>java.sql.SQLException: XA error: XAER_RMERR : A resource manager error
              >has
              >>occured
              >>in the transaction branch start(
              >>) failed on resource 'OracleXAPool' Unexpected error during start for XAResource
              >>'OracleXAPool': null
              >> at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1044)
              >> at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1010)
              >> at weblogic.jdbc.jta.Connection.getXAConn(Connection.java:148)
              >> at weblogic.jdbc.jta.Connection.prepareStatement(Connection.java:226)
              >> at weblogic.jdbc.rmi.internal.ConnectionImpl.prepareStatement(ConnectionImpl.java:135)
              >> at weblogic.jdbc.rmi.SerialConnection.prepareStatement(SerialConnection.java:76)
              >> at examples.ejb.basic.beanManaged.AccountBean.ejbCreate(Unknown
              >>Source)
              >> at examples.ejb.basic.beanManaged.AccountBean_g1748h_Impl.ejbCreate(AccountBean_g1748h_Impl.java:172)
              >> at java.lang.reflect.Method.invoke(Native Method)
              >> at weblogic.ejb20.manager.DBManager.create(DBManager.java:492)
              >> at weblogic.ejb20.manager.DBManager.remoteCreate(DBManager.java:462)
              >> at weblogic.ejb20.internal.EntityEJBHome.create(EntityEJBHome.java:190)
              >> at examples.ejb.basic.beanManaged.AccountBean_g1748h_HomeImpl.create(AccountBean_g1748h_HomeImpl.java:76)
              >> at examples.ejb.basic.beanManaged.AccountBean_g1748h_HomeImpl_WLSkel.invoke(Unknown
              >>Source)
              >> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
              >> at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
              >> at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
              >> at weblogic.rmi.internal.BasicServerRef.dispatch(BasicServerRef.java:158)
              >> at weblogic.rmi.internal.ServerRequest.sendOneWayRaw(ServerRequest.java:92)
              >> at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:112)
              >> at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:253)
              >> at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:220)
              >> at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
              >> at $Proxy126.create(Unknown Source)
              >> at examples.wtc.atmi.simpapp.ToupperBean.putMessage(ToupperBean.java:194)
              >> at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl.putMessage(ToupperBean_8roqg7_EOImpl.java:284)
              >> at examples.wtc.atmi.simpapp.ToupperBean_8roqg7_EOImpl_WLSkel.invoke(Unknown
              >>Source)
              >> at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:288)
              >> at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:257)
              >> at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              >> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >>/////////////////////////////////////////////////////////////////////////////////
              >>
              >>Regards
              >>Ranga Rao
              >>
              >>
              >
              

  • EJB 3.0 JPA Entities and preserving user identities

    Hello all,
    I've been reading about some of the techniques available to Oracle DB developers to ensure that some sense of a user's real identity is maintained in multitier applications (<http://download-uk.oracle.com/docs/cd/B19306_01/network.102/b14266/apdvprxy.htm>).
    I was wondering if either of the methods described (proxy authentication or the use of the CLIENT_IDENTIFIER attribute) could be used in conjunction with EJB 3.0 JPA Entity beans (in an OC4J container).
    If so, I would really appreciate any pointers to useful documentation! I've read something about the use of proxy authentication with TopLink (<http://www.oracle.com/technology/products/ias/toplink/doc/11110/relnotes/toplink-relnotes.html#BABHEFEF>), but I'm not sure how this relates to the use of Entity beans.
    Many thanks,
    Alistair.

    Just to close this thread out...
    Under another thread: <JPA Entities with Proxy Authentication / OC4J bug it was determined that this is NOT possible with OC4J 10g, but should be supported by 11g.
    Alistair.

  • Isolation Level in Distributed Transaction

    Hi All,
    I setup a distributed transaction with a Serializable isolation level.
    When the OracleConnection enlists the distributed transaction I have read-commited isolation on Oracle allowing the transaction to perform inconsistent reads.
    Is the Oracle Provider ignoring the distributed transaction isolation level?
    How can I make the provider set the appropriate isolation level?
    Thanks a lot,
    BMoscao

    Hi,
    i've got the same problem.
    Could you solve it?
    thanks

  • EJB 3.0 and JTA (Distributed transactions)

    hi, first of all sorry for my english.
    then :)
    i'm working with JBoss Aplication Server an Oracle DataBase using EJB 3.0
    i have no problem before ... but now i want work with multiple database and i wand to manage transactions ... how i understand JTA (Java Transaction Api) is a technology for it.
    i think that i need two datasource file for example oracle-xa-ds.xml and postgres-ds.xml
    <datasources>
      <xa-datasource>
        <jndi-name>XAOracleDS</jndi-name>
        <track-connection-by-tx/>
        <isSameRM-override-value>false</isSameRM-override-value>    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
        <xa-datasource-property name="URL">jdbc:oracle:thin:@192.9.200.177:1521:devnbtwo</xa-datasource-property>
        <xa-datasource-property name="User">paata</xa-datasource-property>
        <xa-datasource-property name="Password">1982226</xa-datasource-property>   <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
        <no-tx-separate-pools/>
          <metadata>
             <type-mapping>Oracle9i</type-mapping>
          </metadata>
      </xa-datasource>
      <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter"
             name="jboss.jca:service=OracleXAExceptionFormatter">
        <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
      </mbean>
    </datasources>
    <datasources>
      <local-tx-datasource>
        <jndi-name>PostgresDS</jndi-name>
       <connection-url>jdbc:postgresql://localhost:5432/Test</connection-url>
        <driver-class>org.postgresql.Driver</driver-class>
        <user-name>postgres</user-name>
        <password>1982226</password>
            <new-connection-sql>select 1</new-connection-sql>
          <metadata>
             <type-mapping>PostgreSQL 7.2</type-mapping>
          </metadata>
      </local-tx-datasource>
    </datasources>and i dont know what should i do in my persistance.xml file ..... when i was working with single database my persistance.xml file was working
    <?xml version="1.0" encoding="UTF-8" ?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
         version="1.0">     
         <persistence-unit name="Oracle" transaction-type="JTA">
              <jta-data-source>java:/XAOracleDS</jta-data-source>
              <class>com.magti.businesslayer.ejb3entity.Group</class>
              <class>com.magti.businesslayer.ejb3entity.Student</class>
              <properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
                   <property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver"/>
                   <property name="hibernate.connection.url" value="jdbc:oracle:thin:@192.9.200.177:1521:devnbtwo"/>
                   <property name="hibernate.connection.username" value="paata"/>
                   <property name="hibernate.connection.password" value="1982226"/>
                   <property name="hibernate.default_schema" value="PAATA"/>
              </properties>
         </persistence-unit>     
    </persistence>but then i added anothe unit for second database and i get error
         <persistence-unit name="PostgreSql" transaction-type="JTA">
              <jta-data-source>java:/PostgresDS</jta-data-source>
              <class>com.magti.businesslayer.ejb3entity.Group</class>
              <class>com.magti.businesslayer.ejb3entity.Student</class>
              <properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
                   <property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
                   <property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/Test"/>
                   <property name="hibernate.connection.username" value="postgres"/>
                   <property name="hibernate.connection.password" value="1982226"/>
                   <property name="hibernate.default_schema" value="postgres"/>
              </properties>
         </persistence-unit>     i don't know how i resolve it .
    i can't find any simple exaplme about distributed transactions on net ...
    can anybody help me ....
    thanks.

    Check this one:
    http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html

  • Can oracle temporary tables be used with distributed transactions?

    Hello,
    Does anybody know if temporary tables are supported with distributed transactions?
    We use a temporary table to store query results and see no problems when the JDBC driver (Type 2 or Type 4) is used with local transactions. The temporary tables are set for transaction-level data persistence (delete rows on commit).
    When we switch to JDBC/XA driver we occasionally get ORA-14450 error (java.sql.SQLException: ORA-14450: attempt to access a transactional temp table already in use).
    Many thanks...

    I have been able to use temporary tables on remote databases, so I don't think that it is forbidden. Of course, I'm not using JDBC so that might be a problem.
    The other thing that occurs to me is that you are doing something other than DML with the table e.g. trying to drop it. If that is the case you should re-read the documentation and remind yourself of the purpose of temporary tables.
    Cheers, APC

  • Transaction in EJB with ADF 11

    When i using to query update data in database, in database changed but on jspx not change? help me.

    Hi,
    I'm not sure if your question is related to SALT or even Tuxedo, but in the event that it is, what comes to mind is that transactions between Tuxedo and a Java application server are loosely coupled at best. If your question is around SALT and using SALT to connect to a Java Web Service, then in that case with SALT 10gR3 there is no distributed transaction support between Tuxedo and the Java Web Service. So if the Tuxedo application and the Java application access the same data in the same database, they will see different values as they will be part of different transactions. Even with the upcoming support for WS-AtomicTransaction, distributed transactions will still be loosely coupled, i.e., each branch will appear to the resource manager as a different transaction, thus there is likely to be visibility issues.
    If you are using Tuxedo and WTC with its distributed transaction support, you will still have the loosely coupled transaction issue.
    In general it's best not to have multiple branches of a distributed transaction trying to access the same data.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Problem with ORA-02046: distributed transaction already begun

    I can use db link from the source machine but not the vice versa, throws ORA-02046. I restarted Oracle, rebooted the
    machine, yet ORA-02046 persists. No entries in dba_2pc_pending in any (target, db-linking) machines. Can anybody suggest how
    can I resolve this issue? It is eating out our production time.
    Thanks in advance,

    I had already checked the link, Thanks.
    I bounced Oracle in the suspicious (one that was doubted to have started the distributed transaction) machine, then it resolved the issue.
    Thanks

Maybe you are looking for

  • Receiver File adapter - 'Empty Message Handling' option to ignore not worki

    Hi,   I am trying to create the Files in receiver based on condition.But I am gettiung error in communication channel when there is no payload. Receiver I am usuing FCC and processing tab I selected -'Empty Message Handling' option to ignore . one so

  • Can't download updates from appstore after mountain lion install

    after installing mountain lion, i cannot download the update for Keynote (version 5.2)  in the Appstore. I get since installing mountain lion continuously (for 2 days now) a message dat een error is occuring in App store and that i should try again l

  • Calculate percentage based on checkbox results in Numbers iOS

    Using Numbers iOS, I've created a gradebook to keep track of my students' progress. I have used the Checkbox format for my results, and I would like to create a formula that will calculate a percentage based off of the checked results. What formula c

  • Why in the levels box, "OK" is missing in the layers side, but not in the other?

    I have used several past versions of Elements.  The past Levels control had an OK Button to use when I was done with the adjustment.  Elements 9 does not have the OK button on the layers side, but does have it using the Enhanse drop down menu or Ctrl

  • LDB BRFChanges

    HI Experts, need ur expertise for me... i have a requirement to copy a std program which is using LDB BRF i need to add 2 extra fields in the selection screen.i.e acc to ldb company code,billing doc and period is the three fields now i want gl a/c ,c