Database to Middleware distributed transaction control

Hello!
I'm using RMI in a JAVA stored procedure to invoke an external remote object's method (deployed in an application server). Is there any solution to manage the global transaction between database and middleware?
I've the same kind of invocations but from middleware to middleware and in that cases JTA (weblogic transaction manager) manage the transaction.
I've this big challenge in hands. Any idea?
Thanks a lot

Hi Kata,
this won't work as the ALL_TABLES is not a table that exists in your SQl Server  - instead it is a "mimicked" table. This means the gateway will check if you have on your SQL Server a table called all_tables and when there's no table it will start an internal mechanism to check out what sort of tables exist in your SQL Server database. So the gateway is starting internally another transaction to get details from the foreign database and DG4ODBC can't participate in distributed transactions at all. Instead of using all_tables you have to use a real SQL Server table like SQ Server sys.objects or sys.tables.
- Klaus

Similar Messages

  • How to configure distributed transaction in Oracle Database Gateway for ODBC? (ORA-02047)

    I am connecting from Oracle to another database server (MS SQL Server, DB2 the error message is the same) through an ODBC connection using Oracle SQL Developer. (This is how I set up)
    I want to query the schema of a non-Oracle database using the data dictionary mapping of the Oracle Database Gateway for ODBC.
    This works well:
    select * from all_tables@katimssql;
    But this doesn't:
    create table alltables_mssql as
    select * from all_tables@katimssql;
    Output:
    Error report:
    SQL Error: ORA-00604: error occurred at recursive SQL level 1
    ORA-02047: cannot join the distributed transaction in progress
    ORA-06512: at "SYS.HS$_DDTF_SQLTABLES", line 58
    ORA-06512: at line 1
    Does anyone know the solution of this?
    Thanks in advance,
    Kata
    Details:
    Oracle Database 11g Express Edition Release 11.2.0.2.0
    Microsoft SQL Server 2008 (SP2) - 10.0.4000.0 (X64)
    ODBC Driver: SQL Server Native Client 11.0 (32 bit)
    initkatimssql.ora:
    HS_FDS_CONNECT_INFO=katimssql
    HS_FDS_TRACE_LEVEL = ON
    HS_TRANSACTION_MODEL = READ_ONLY_AUTOCOMMIT
    I tried these, none of them worked, the error message is the same.
    HS_FDS_TRACE_LEVEL = off
    HS_TRANSACTION_MODEL = SINGLE_SITE
    HS_TRANSACTION_MODEL = READ_ONLY_AUTOCOMMIT
    HS_TRANSACTION_MODEL = READ_ONLY

    Hi Kata,
    this won't work as the ALL_TABLES is not a table that exists in your SQl Server  - instead it is a "mimicked" table. This means the gateway will check if you have on your SQL Server a table called all_tables and when there's no table it will start an internal mechanism to check out what sort of tables exist in your SQL Server database. So the gateway is starting internally another transaction to get details from the foreign database and DG4ODBC can't participate in distributed transactions at all. Instead of using all_tables you have to use a real SQL Server table like SQ Server sys.objects or sys.tables.
    - Klaus

  • Do I need Distributed Transaction Scope when I have Two Database in Single SQL Server Instance

    Dear Sirs.
    I have Two Database in SQL Server Express 2008 R2, I Move Row From Database 1 Table 1 to Database 2 Table 1
    Do I need Distributed Transaction or just regular Transaction.
    Thank you in Advance. 
    Irakli Lomidze

    Dear Sirs.
    I have Two Database in SQL Server Express 2008 R2, I Move Row From Database 1 Table 1 to Database 2 Table 1
    Do I need Distributed Transaction or just regular Transaction.
    Thank you in Advance. 
    Irakli Lomidze
    Whats you are doing does not qualify under distributed transaction. Please read about distributed transaction from below link
    http://technet.microsoft.com/en-us/library/ms188721%28v=sql.105%29.aspx
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • Weblogic 5.1, Distributed Transaction and Oracle Database Link

    We are planning to add a new functionality to run in Weblogic server and it
    needs to update tables in two different Oracle databases. Since we are using
    Weblogic 5.1 and it is unrealistic to upgrade to 6.1 in short term, we have
    to deal with the fact that distributed transaction is not supported by JTS
    on 5.1.
    One workaround we can think of is to utilize Oracle database link. Instead
    of having two connection pools, the application talks to only one database
    and access the tables on the other ones through Oracle database link.
    Therefore, when a session bean tries to update two tables on database 1 in
    one transaction, one of the tables is just a link to the other database. We
    hope that even though distributed transaction is not supported by JTS in
    Weblogic 5.1, but since it is supported by Orable, it would work.
    Do you think the above workaround would work? Does anyone have experience on
    something like that?
    Thanks in advance,
    David Chen
    [email protected]

    Hi. You should be able to use any JDBC driver with WebLogic 5.1.
    It may be the JVM that complains, if you use too old a JVM...
    Joe Weinstein at BEA Systems

  • 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의 2 PHASE COMMIT 개념 및 절차

    제품 : ORACLE SERVER
    작성날짜 : 2002-05-15
    DISTRIBUTED TRANSACTION의 2 PHASE COMMIT 개념 및 절차
    ====================================================
    Oracle이 분산 트랜잭션 수행을 위해 사용하는 2 phase commit의 자세한 개념
    및 절차를 살펴본다.
    1. 용어와 개념
    Oracle은 분산 트랜잭션을 수행하면서 여기에 포함된 모든 node에 대해서
    session tree를 구성한다. session tree는 분산 트랜잭션에 관여되는 session과
    각 session의 역할을 계층적인 tree형태로 표현한다고 볼 수 있으며,
    DBA_2PC_NEIGHBORS view를 통해 확인 가능하다.
    session tree에 포함되는 각 node들이 수행하는 역할은 2 phase commit 절차의
    기본적인 개념이 되므로, 분산 트랜잭션의 이해를 위해서 정확히 파악할 필요가
    있다. 아래에 각 역할 들의 종류와 의미를 설명하며 [그림 1]을 예로 든다.
    - client
    - database server
    - global coordinator
    - local coordinator
    - commit point site
    insert into seoul_tab...;
    delete from pusan_tab@pusan...;
    Seoul.world inchoen_procedure@incheon...;
    / \ incheon_procedure source
    Pusan.world Inchoen.world ------------------------
    \ delete from incheon_tab...;
    \ update jeju_tab@jeju...;
    Jeju.world
    [그림 1] session tree의 간단한 예제
    (1) client: 다른 node의 database 정보를 이용하면 client가 된다.
    참조되어지는 node는 이때 database server가 된다. seoul.world가
    pusan.world와 incheon.world의 client이고, incheon.world는 jeju.world의
    client가 된다.
    (2) server (database server): 분산 트랜잭션에 포함된 모든 node를 server라
    한다. seoul.world, pusan.world, incheon.world, jeju.world 모두 database
    server이다.
    (3) global coordinator:분산 트랜잭션을 처음 수행시킨 node를 의미한다.
    여기서는 seoul.world가 global coordinator이다.
    (4) local coordinator: 분산 트랜잭션에서 이 node에 관계된 부분의 결과를
    얻으려면 다른 node를 참조해야 하는 경우 이 node를 local coordinator라고
    한다. 이것이 위에서 설명한 global coordinator와는 차이가 있는데 global
    coordinator는 항상 local coordinator이지만, 반대로 local coordinator는
    global coordinator가 아닐 수 있다.
    Incheon.world의 경우 처음 문장을 수행시킨 global coordinator는 아니지만,
    Incheon.world의 Inchoen_procedure내에 jeju.world가 reference되므로
    local coordinator가 된다. seould.world는 global coordinator이면서
    local coordinator가 된다.
    (5) commit point site
    commit point site는 분산 트랜잭션에 관여된 node중 2 phase commit단계에서
    commit이나 rollback을 항상 제일 먼저 하게 된다. 이 node의 local
    transaction부분은 prepared상태를 거치지 않아 in-doubt 상태가 되는 일이
    없고, 그러므로 distributed lock에 의해 조회나 DML시 오류가 발생하는
    없게 된다. 이러한 이유로 제일 중요한 data를 포함하는 중심이 되는 node를
    commit point site로 지정하는 것이 바람직하다.
    commit point site는 각 node의 initialization parameter중
    COMMIT_POINT_STRENGTH 값을 비교하여 제일 큰 값을 가진 node가 지정된다.
    두 node만 관여된 분산 트랜잭션의 경우 commit_point_strength가 지정되어
    있지 않으면, default로 global coordinator가 아닌 node가 commit point
    site가 된다.
    2. 2 Phase Commit (2PC)
    분산 트랜잭션을 commit하는 것은 다음 두 단계를 거치게 된다. 그래서 Oracle의
    분산 트랜잭션은 2 phase commit mechanism을 사용한다고 한다.
    prepare 단계: global coordinator (SQL문장을 처음 수행한 server) 가 commit
    point site를 제외한 나머지 node에게 prepare하도록 요청한다.
    요청을 받은 node는 각 local db에서의 작업에 대해 commit이나
    rollback할 준비를 마치고 다시 global coordinator에게 prepare
    되었음을 알려 주는 단계이다.
    node가 prepare 단계를 지나고 commit을 완료하기 전까지는
    transaction이 in-doubt상태라고 부른다.
    commit단계: 모든 node가 정상적으로 prepare가 되면, 먼저 commit point site가
    commit을 완료하고 이후 다른 node들도 commit을 완료하게 된다.
    이렇게 분산 트랜잭션에서 commit을 수행하기 위해 두 단계를 거치면서 일부
    node만 commit이 되고 일부는 rollback이 되는 불일치 상태를 막을 수 있는데,
    그러기 위한 자세한 단계별 처리 절차를 아래 [표 1]에 17단계로 기술하였다.
    각 단계별로 global coordinator와 commit point site, 그리고 둘 모두에
    해당되지 않는 일반 database server입장으로 나누어 표시하였으며, 만약 어떤
    node가 global coordinator이면서 commit point site라면, 두 part의 일을 모두
    하게 되는 것이다.
    아래 표의 (4) ~ (10)번 단계는 prepare단계의 작업이며, (11) ~ (15)번 단계는 commit단계
    이다. 부가적으로 (16), (17)을 정리 단계로 부르기도 한다.
    단계| Global coordinator | 참여한 db server | Commit point site
    (commit point site도 아니고
    global coordinator도 아닌경우)
    (1) SQL문장 발생 |     |
    (2) SQL문장이 수행되면 session tree가 구성되고 이 정보는
    DBA_2PC_NEIGHBORS를 통해 조회 가능하다.
    변경이 필요한 data는 각 node별로 자기의 local data에 대해서 lock
    (TX,TM)을 걸면서 문장 수행이 진행된다.
    (3) Commit; 문장 발생 |          |
    (4) commit point site를 |          |
    commit_point_strength |          |
    initial parameter를 참조 |          |
    하여 결정하고, |          |
    참여한 모든 node의 SCN중 |          |
    제일 큰 값을 commit SCN으로|           |
    결정하고 이후에 각 node의 |          |
    commit시 이용한다. |          |
    (5) commit point site를 |          |
    제외한 모든 node들에게 |          |
    prepare하도록 요청한다 |          |
    (6) prepare 요청 message받는다 |
    (7) transaction이 이 node의 data를 변경하였는지를 |
    확인하고, 변경 사항이 있고 commit이 가능한 |
    상태이면 다음 단계를 수행하고, 그렇지 않으면 |
    (10)번 단계로 건너뛴다           |
    (8) transaction에 distributed lock을 걸어 fail이 |
    되어도 rollback이 되지 않고 변경 사항에 lock이|
    걸린 채 유지되도록 한다.           |
    distributed lock이 걸려 있는 상태에서는 변경 |
    data를 포함한 block에 포함된 어떤 data도 |
    read/write가 불가능하게 된다 (ora-1591발생) |
    [참조 1]                    |
    (9) transaction에 의해 변경된 내용과 (8)번 단계의 |
    information에 대한 redo log 내용을 각 node의 |
    redo log file에 기록한다. (해당 node의 변경 |
    사항만을 해당 node의 redo log file에 기록) |
    (10) global coordinator에게 다음 세가지 중 하나의 |
    상태를 prepare message대한 응답으로 전달한다.|
    PREPARED:변경된 data가 있고 commit이 가능한 |
    상태               |
    READ-ONLY: 자신의 node에는 data 변경사항이 |
    없고 조회만 관여한 경우 |
    ABORT: 오류 발생으로 인해 commit이 불가능한 |
    경우                     |
    (11) prepare 요청 message에 | |
    대한 응답 중 한 node라도| |
    abort가 있으면: | |
    모든 관여된 node를 | |
    rollback하도록 요청하고 | |
    distributed transaction | |
    을 끝낸다. | |
    prepare요청 message에 | |
    대한 응답이 read-only나 | |
    prepared만 있다면: | |
    commit point site에게 | |
    commit하라고 요청한다. | |
    (12) | |이 node에 관여된 local
    | |transaction 부분만을
    | |commit 한다.
    | |- data변경사항과 commit
    | |정보를 local redo log
    | |file에 기록한다.
    | |- commit SCN은 (4)번단계
                   |           |에서 얻어진, 관여된 node
                   |          |의 SCN중 제일 큰 값을
    | | 이용한다.
                   |     |- (2) 번 단계에서 잡혔던 TX,
    | | TM lock은 해제된다.
    (13) |global coordinator에게
    |commit이 완료되었음을
    |알리는 message를 보낸다.
    (14) commit point site를 제 | |
    외한 다른 node들에게 | |
    commit하라고 요청한다. | |
    (15) commit하면서 (2)번 단계에서 잡은 TX, TM lock|
    과, (8)번 단계에서 잡힌 distributed lock을 |
    release하고, 이러한 commit정보를 redo log |
    file에 기록한다.
    (16) | |DBA_2PC_PENDING,
    | |DBA_2PC_NEIGHBORS등
    | |dictionary 저장된 정보를
    | |지우고 global coordinator
    | |에게 정보를 지웠음을
    | |알려준다
    (17) DBA_2PC_PENDING, DBA_2PC_NEIGHBORS 등 |
    dictionary 저장된 정보를 지우고 정리한다. |
    [참조 2] |
    [표 1] 2 phase commit의 단계별 절차
    [참조 1] distributed lock
    (8)번 단계에서 기술한 distributed lock은 실제 v$lock을 확인하여서는
    나타나지 않는다. v$lock에 lock type이 DX로 나타나는 것은 distributed
    transaction lock으로 이것은 2 phase commit을 위한 것이 아니라
    XA에서 단일 transaction내에서 여러 branch에 대한 control을
    tightly-coupled 형태로 하는 경우에 사용되어 지는 것이므로, 여기서
    언급하는 distributed lock과 혼동되어서는 안된다.
    여기에서 설명한 distributed lock은 실제 type을 가지고 있는 lock이
    아니고 해당 transaction에 대한 local db내의 rollback segment
    header부분에서 transaction상태를 prepared를 나타내는 bit로
         설정함으로써 lock설정을 구현한다.
    그러므로 이 lock이 걸려 있는 동안은 다른 transaction이 해당 분산
    트랜잭션이 변경한 data와 같은 block의 어떠한 data라도 읽거나
    쓰려고 하면, 그 block에 commit되지 않은 transaction이 있다는 것을
    인식하고 before image를 읽기 위해 rollback segment를 찾게 되고,
    그 rollback segment에 prepared상태로 표시되어 있어 before image
    읽는 것을 막기 때문에 오류가 발생하게 된다. 이 오류가 ORA-1591이
    되는 것이다.
    transaction이 prepared상태로 distributed lock이 걸린 상태인지는
    DBA_2PC_PENDING의 status가 PREPARED인지를 확인하는 것만이
    dictionary를 통해 가능한 정보이다.
    [참조 2] DBA_2PC_PENDING의 정보
    DBA_2PC_PENDING view의 정보는 분산 트랜잭션이 비정상 종료 되었을
    때만 정보가 저장되는 것이 아니다. 앞의 [표 1]의 2 phase commit
    단계마다, 수행되는 작업에 대해서 해당 view에 계속해서 정보를
    변경해 가고 앞의 표의 (16), (17) 단계를 완료해야 지워지게 된다.
    분산 트랜잭션이 비정상 종료시 이 view에서 해당 transaction의
    상태가 COLLECTING이나 PREPARED, COMMITTED 상태로 정보가 보여지는
    것은 마지막 정리 단계 수행 전에 transaction이 종료되었기 때문이다.
         non-commit point site의 경우, (10)번 단계에서 distributed lock을
    걸기 전까지는 DBA_2PC_PENDING의 STATE column 값이 COLLECTING으로
    나타나게 되며, (15) 단계 수행전까지는 PREPARED로 나타나고, (17)번
         수행전까지는 COMMITTED로 나타난다.
    commit point site의 경우는, (11)번 수행단계까지는 이 view에 어떠한
    정보도 포함하지 않으며, (12)번 수행 후 (16)번 단계를 수행하기
    전까지는 COMMITTED로 STATE 값을 가지게 된다.

  • Distributed transactions 10gr2

    hi,
    I have a couple of RAC databases (10.2.0.1) which are giving intermittent errors and the cause of the errors is that there are distributed transactions that are not completing. For example, in the dba_2pc_pending table there are 14 entries which persist following the shutdown/startup of the databases. And this leads to the question i have which is how does Oracle decide how long to retry the transactions? Is there a parameter that can be set/adjusted so that it just checks for a couple of days? Eventually the transactions are ditched, but the alert logs for the databases show the errors and the RECO process adds entry to a *reco_nnn.trc file.
    this file then shows erros such as
    e.g. ERROR,tran=1.24.34338,session#=1,ose=0
    I have seen a mention of looking at distributed transactions in OEM but can't see a link for that there.
    Any help with this appreciated.
    regards,
    Malcolm.

    Dear user12122880,
    If i were you i would use the COMMIT FORCE statement to end the pain of those in-doubt transactions :)
    You have to be careful with those transactions that query outside the database without commiting or rolling back.
    Regards.
    Ogan
    Edited by: Ogan Ozdogan on 22.Ara.2010 14:41
    Dear user12122880,
    Also there is one more recommendation that i can give. Name the transactions!
    SQL> SET TRANSACTION NAME 'my_transaction';
    Transaction set.You can control the transactions in the v$transaction view easily if there is a name defined for the transaction.

  • Oracle Link for Distributed Transaction

    In my application, I've to integrate two system (or I would say two separate instances of Oracle databases) through a Java Program.
    Program will copy some data (approximately 100 records/hour) from one instance of Oracle database and transfer the same to other instance of Oracle and Vice versa. Since this is going to be a stand alone batch application, I thought of using Distributed Transaction Manager like JBOSS TM for controlling distributed transaction.
    Is this approach right? Or can you suggest me any other better approach for this job?

    853627 wrote:
    I do agree with your Oracle Link explanation, and Yes that would be ideal to have in this case. For some reason, I'm forced to use the Java way.
    Why i'm using the distributed transaction because, I'm following certain steps to complete one iteration:
    1) Read the data from Database A,
    2) Move the data to Database B
    3) After successful execution of Step 1 and 2, There is another table in Database A where I need to mark that certain records have been migrated from Database 'A' to 'B'
    4) After that I've to update a summary table with details of the migration like : Number of records read, Time when this routine completed, any validation error in records etc..Distributed transactions require database level support and complications.
    But I don't see anything that suggests you need this.
    First step is no transaction based.
    Only failure point is between 2 and 3/4. And I suspect you could handle that with a tracking table in A.
    1) Start transaction, Read the data from Database A, Update tracking table, end transaction.
    2) Move the data to Database B
    3) Start Transaction
    4) After successful execution of Step 1 and 2, There is another table in Database A where I need to mark that certain records have been migrated from Database 'A' to 'B'
    5) (Presumably A) After that I've to update a summary table with details of the migration like : Number of records read, Time when this routine completed, any validation error in records etc..
    6) Clean tracking table
    7) End transaction.
    If there is a failure, then use the tracking table to facilate correction.

  • 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

  • Problem: [Microsoft][ODBC SQL Server Driver][SQL Server]The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.

    Hi Gurus,
    I have this problem in my MS SQL Server 2012 that is running in SQL Server 2008 R2 Enterprise 64 bit.. Not sure why... Here is the full details of the error:
    Microsoft OLE DB Provider for ODBC Drivers 80040E14
    [Microsoft][ODBC SQL Server Driver][SQL Server]The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.
    /Libraries/DBA/DBA.asa, line 717
    Line 717 is this:
    rs.open destTableName,,,,adCmdTable
    Full details of the code:
        'Field object used to iterate through each field of the rs
        dim rs, fld
        'call dbInitRS(rs)
        set rs = server.createobject("adodb.recordset")
        'On Error Resume Next
        'Open rs
        set rs.activeConnection = myConnection
        rs.cursorType = adOpenKeyset
        rs.lockType = adLockOptimistic
        'rs.open destTableName
        rs.open destTableName,,,,adCmdTable
        'if err.number <> 0 then
        '    goto HandleError
        'end if
        rs.addNew
    Any ideas how to solve this problem?
    Thanks

    Still does not work. I have allow MSDSTC in my firewall list.
    Hi dudskie,
    Have you try to use DTCTester or DTCPing to verify MSDTC functionality over the network? Please refer to the following article:
    Troubleshooting Problems with MSDTC:
    http://msdn.microsoft.com/en-us/library/aa561924.aspx
    Use the DTCTester utility to verify transaction support between two computers if SQL Server is installed on one of the computers. The DTCTester utility uses ODBC to verify transaction support against a SQL Server database. For more information about
    DTCTester see How to Use DTCTester Tool.
    Use DTCPing to verify transaction support between two computers if SQL Server is not installed on either computer. The DTCPing tool must be run on both the client and server computer and is a good alternative to the DTCTester utility when SQL Server
    is not installed on either computer. For more information about DTCPing, see
    How to troubleshoot MS DTC firewall issues.
    If you have any feedback on our support, please click
    here.
    Hope this helps.
    Regards,
    Elvis Long
    TechNet Community Support

  • How to disable distributed transaction in Weblogic 8.1?

              Hi I'm using WL8.1 running EJB. I wish to disable distributed transaction, whatever
              that is. It is preventing me from doing and AutoCommit(true) in my database. Please
              help. Thanks!
              

    You cannot disable transactions if you are using entity EJBs but you can
              get your connections from a non-TX DataSource (just define a regular
              DataSource and not TXDataSource in your configuration) and then those
              connections will not be transaction aware so you'll be able to do
              setAutoCommit(true) in fact it might already be the default setting when
              you get the connection.
              Regards,
              Dejan
              Fred wrote:
              >Hi I'm using WL8.1 running EJB. I wish to disable distributed transaction, whatever
              >that is. It is preventing me from doing and AutoCommit(true) in my database. Please
              >help. Thanks!
              >
              >
              

  • ORA-00164 Autonomous and Distributed Transactions in Oracle 8i - Forms6i

    Hi, in Forms6i I'm using Autonomous transactions (insert and update), and I want to use also a database link to make a query in a remote database (Distributed transaction). Even when this request are done in different PL/SQL within Forms6i, I get the error message ORA-00164 Distributed transactions disallowed within autonomous transactions. Is there a way to avoid this error message?
    Thanx

    Hello,
    I had a similar Problem, when I tried to log errormessages while selecting by db-link.
    I use pipes now to send the errormessages. The pipe is read at regular intervals and then I can Insert without using autonomous transactions.
    I hope, this will help you
    Marcus

  • ORA-02074: cannot ROLLBACK in a distributed transaction

    I have a stored procedure that successfully creates a portal user when I run it with SQLPLUS.
    However when I call the same procedure through ODP.Net, I get the following error.
    "ORA-20001: ORA-02074: cannot ROLLBACK in a distributed transaction\nORA-06512: at \"PORTAL30.WWSEC_API\", line 1915\nORA-02074: cannot SET SAVEPOINT in a distributed transaction\nORA-06512: at \"PORTAL30.PRO_CREATE_WEB_USER\", line 28\nORA-06512: at line 1"
    The portal version is 3.0.9.8.2 The stored proc is in the portal30 schema and I am connecting as portal30 user.
    Any help is greatly appreciated...
    Thanks.
    The following is the code for the stored procedure:-
    CREATE OR REPLACE PROCEDURE PORTAL30.PRO_CREATE_WEB_USER (
    puser IN varchar2,
    puser_last_name IN varchar2,
    puser_first_name IN varchar2,
    puser_group IN varchar2,
    password IN varchar2
    ) AS
    l_group_id number;
    l_id number;
    e_code number;
    begin
    l_id := wwsec_api.add_portal_user(p_User_Name => puser,p_Last_Name => puser_last_name,p_First_Name => puser_first_name,p_Portal_User => 'Y');
    wwsec_api.activate_portal_user(puser);
    portal30_sso.WWSSO_API_USER_ADMIN.CREATE_USER(P_USERNAME=> puser,P_PASSWORD=>password,p_error_code=> e_code);
    wwsec_api.add_user_to_list(p_person_id => l_id,p_to_group_id => wwsec_api.group_id (p_name => puser_group),p_is_owner => wwsec_api.NOT_OWNER);
    wwsec_api.set_defaultgroup(p_groupid => wwsec_api.group_id (p_name => puser_group),p_username => puser);
    commit;
    exception
    when others then
    raise_application_error(-20001,substr(sqlerrm,1,200));
    end;
    The foll is the code I am using to call the stored proc.
    private void createUser()
    string retval ;
    OracleConnection oraconn = new OracleConnection(Data Source=testdb;User ID=portal30;Password=portal30" );
    OracleCommand cmd = new OracleCommand("PRO_CREATE_WEB_USER", oraconn);
    cmd.CommandType = CommandType.StoredProcedure;
    OracleParameter a_uid = new OracleParameter("puser" ,OracleDbType.Varchar2,20);
    a_uid.Direction = ParameterDirection.Input ;
    a_uid.Value = (txtUserId.Text).Trim() ;
    cmd.Parameters.Add(a_uid);
    OracleParameter a_last_name = new OracleParameter("puser_last_name" ,OracleDbType.Varchar2,20);
    a_last_name.Direction = ParameterDirection.Input ;
    if (( txtLName.Text).Trim() != "" )
    a_last_name.Value = (txtLName.Text).Trim() ;
    else
    a_last_name.Value = " ";
    cmd.Parameters.Add(a_last_name);
    OracleParameter a_first_name = new OracleParameter("puser_first_name" ,OracleDbType.Varchar2,20);
    a_first_name.Direction = ParameterDirection.Input ;
    if ((txtFName.Text).Trim() != "")
    a_first_name.Value = (txtFName.Text).Trim() ;
    else
    a_first_name.Value = " ";
    cmd.Parameters.Add(a_first_name);
    OracleParameter a_type = new OracleParameter("puser_group" ,OracleDbType.Varchar2,20);
    a_type.Direction = ParameterDirection.Input ;
    a_type.Value = (lstUserType.SelectedValue).Trim() ;
    cmd.Parameters.Add(a_type);
    OracleParameter a_passwd = new OracleParameter("password" ,OracleDbType.Varchar2,20);
    a_passwd.Direction = ParameterDirection.Input ;
    a_passwd.Value = (txtPassword.Text).Trim() ;
    cmd.Parameters.Add(a_passwd);
    try
    oraconn.Open();
    cmd.ExecuteNonQuery();
    lblMsg.ForeColor = System.Drawing.Color.FromName("blue");
    lblMsg.Text = "User Created.";
    catch(OracleException e)
    { retval = e.Message ;
    lblMsg.ForeColor = System.Drawing.Color.FromName("red");
    lblMsg.Text = "Error Creating user" ;
    finally
    oraconn.Close();

    Also note that remote procedure/function calls (e.g. from ODP.NET), do not support distributed transactions (i.e. a SAVEPOINT/ROLLBACK block within the PL/SQL procedure/function) before database version Oracle 9i.
    So if you are using say Oracle 817 you must use the "OracleTransaction" object in ODP.NET instead.
    See:
    http://www.dotnet247.com/247reference/msgs/39/197274.aspx

  • Need help on  ORA-02074: cannot SET NLS in a distributed transaction

    Hi All,
    I am Writing a plsql Code like this
    DECLARE
    op_job_id NUMBER;
    op_object_version_number NUMBER;
    x_job_definition_id NUMBER;
    op_name VARCHAR2(1000);
    L_VERIFY_FLAG VARCHAR2(1);
    l_error_message VARCHAR2(2000);
    BG_ID NUMBER;
    lv_job_group_id APPS.per_job_groups.job_group_id@SYSTEM_LINK_VISMA%TYPE;
    CURSOR C1 IS SELECT * FROM EBS_PER_JOBS_STG;
    BEGIN
    FOR H1 IN C1
    LOOP
    BEGIN
    IF H1.BUSINESS_GROUP_NAME IS NOT NULL THEN
    SELECT BUSINESS_GROUP_ID,job_group_id INTO BG_ID,lv_job_group_id
    FROM APPS.PER_JOB_GROUPS@SYSTEM_LINK_VISMA
    WHERE DISPLAYED_NAME=H1.JOB_GROUP_NAME;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    L_VERIFY_FLAG := 'E';
    l_error_message := 'Entered Job Group Name is Wrong';
    END;
    -->> JOB GROUP ID <<--
    APPS.hr_job_api.CREATE_JOB@SYSTEM_LINK_VISMA
    (p_business_group_id => BG_ID
    ,p_date_from => H1.DATE_FROM
    ,p_approval_authority => H1.APPROVAL_AUTHORITY
    ,p_emp_rights_flag => H1.EMP_RIGHTS_FLAG
    ,p_benchmark_job_flag => H1.BENCHMARK_JOB_FLAG
    ,p_job_group_id => lv_job_group_id
    ,p_job_information1 => H1.JOB_INFORMATION1
    ,p_job_information2 => H1.JOB_INFORMATION2
    ,p_job_information3 => H1.JOB_INFORMATION3
    ,p_job_information4 => H1.JOB_INFORMATION4
    ,p_job_information5 => H1.JOB_INFORMATION5
    ,p_job_information6 => H1.JOB_INFORMATION6
    ,p_job_information7 => H1.JOB_INFORMATION7
    ,p_segment3 => H1.JOB_CODE --JOB_CODE
    ,p_segment6 => H1.JOB_NAME --JOB_NAME
    ,p_job_id => op_job_id
    ,p_object_version_number => op_object_version_number
    ,p_job_definition_id => x_job_definition_id
    ,p_name => op_name);
    dbms_output.PUT_LINE('OUTPUT JOB NAME CREATED : '||op_name);
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.PUT_LINE('Error Message Is: '||SQLERRM);
    END;
    i am running it in Another database Using database link connecting to Apps.
    when i am running it am getting the following Error:
    Error Message Is: ORA-02074: cannot SET NLS in a distributed transaction
    ORA-06512: at "APPS.HR_KFLEX_UTILITY", line 2423
    ORA-06512: at "APPS.HR_KFLEX_UTILITY", line 2380
    ORA-06512: at "APPS.PER_JBT_UPD", line 468
    ORA-02074: cannot SET NLS in a distributed transaction
    ORA-06512: at "APPS.HR_JOB_API", line 878
    Please help me on this, this is quite urgent to me.
    thanks
    sri

    Please see these docs.
    ORA-02074: Cannot SET NLS in a Distributed Transaction [ID 556391.1]
    Portal Used To Call PO_CHANGE_API1_S: ORA-20001: ORA-02074: Cannot SET NLS In A Distributed Transaction [ID 561246.1]Why are Concurrent Programs Calling FND_GLOBAL.APPS_INITIALIZE Using DBLinks Failing? [ID 466800.1]
    ORA-02074 when Executing set_nls over a DB Link [ID 132679.1]
    Thanks,
    Hussein

  • ADF- Jdev11.1.1.6 Business Components supports distributed transaction ?

    Hi ,
    I'm using Jdeveloper 11.1.1.6 release 1 . How to implement distributed transaction in ADF business component level.
    In my scenario i need to perform A Single transaction with two different database . I do need to role back both if either one fails (Distributed Transactions) . How could i achieve this in ADF business component. Does ADF has any built-in support for Distributed transactions.
    Could anybody advice me .
    Thanks in Advanced .

    Thanks for your response !!! What is the best alternative i can choose to achieve Distributed Transaction in ADF Application , if there is no inbuilt support for it in BC?
    Edited by: 994058 on Mar 15, 2013 7:16 AM
    Edited by: 994058 on Mar 15, 2013 7:18 AM

Maybe you are looking for

  • Cal Month Sorting in BO Explorer

    Hi All, I have created an Information space on an universe which is based on BEx query. I have a cal month object used in the info space. My problem here is i am not able to sort it in the standard order (from jan to dec) but it is sorting either bas

  • How to set the column size in OATable

    Hi All, I'm using Oracle EBS 11.5.10 I have a OATable with two columns (messagestyledText), say Col01 and Col02. Is there a way that I can set the width of Col01 and Col02 ? As in 30% of OATable for Col01 and 70% for col02? Thanks for any suggestion/

  • Purchase Requisition & Purchase Order!!

    Hi. How can we add Personal number field in Purchase Requisition and Purchase Order?

  • How to trigger a local process chain to run manually

    Dear Experts, In my company, I have a Daily process chain. In this Daily process chain, it contains many other local process chains which are grouped by modules. For example, I have created the following 3 process chains: - Accounts Receivables Proce

  • Dvd firmware update?

    I'm unable to burn a Philips DVD+RW 1-4x 4.7gb dvd. I get this error code: 0x80020063. I've downloaded SuperDriveFWUv2.0.dmg, but when I install I get a message saying no device needing this upgrade was found. Here's the info about my drive; MATSHITA