"in-doubt distributed transaction" (WLS 8.1 SP2/Oracle 9.2.0.4)

          I've developed an MDB that reads a message from a queue, performs database updates
          against up to 2 databases, and sends an outgoing JMS message when all is complete.
          The MDB uses container-managed transactions to ensure that all DB updates and
          JMS messages are committed or rolled back together. I have had a lot of problems
          related to transactions failing, becoming "in-doubt" in the database and locking
          database resources indefinitely.
          My environment is configured as follows:
          WebLogic 8.1.2 Server
          Oracle 9.2.0.4 database with RAC
          XA Connection Pool with WebLogic Type 2 Oracle Driver OR Oracle 9.2.0.4
          OCI Driver
          I have read the BEA/HP white paper regarding Weblogic 8.1 with Oracle 9i RAC (http://dev2dev.bea.com/products/wlserver81/whitepapers/wls_bea_hp.jsp)
          and have tried all of the solutions suggested in that paper. The only solution
          that worked consistently without causing the in-doubt transactions was to change
          my connection pools to point directly to a single node of the RAC cluster, not
          to the shared instance. However, even with this configuration, I have seen these
          errors occur when certain database failures occur.
          A side-effect of this problem is that the associated WebLogic connection pools
          begin to "forget" connections. The pool thinks that all of the connections are
          in use (even though I am always calling Statement.close() and Connection.close()),
          and the connection pool cannot be reset manually. The only way to clear the connection
          pool is to bounce WebLogic.
          The only posts I have found related to this error were regarding Oracle 8.1.7
          and WebLogic 6.1. Any help would be greatly appreciated.
          Exceptions:
          <Mar 23, 2004 2:59:36 PM EST> <Error> <EJB> <BEA-010026> <Exception occurred during
          commit of transaction Xid=BEA1-0526A28664707F28EDB9(6412513),Status=Rolled back.
          [Reason=javax.transaction.xa.XAException
          : prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID
          is not valid],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds
          left=60,XAServerResourceInfo[JMS_my
          JmsStore]=(ServerResourceInfo[JMS_myJmsStore]=(state=rolledback,assigned=myserver),xar=JMS_myJmsStore),XAServerResourceInfo[ProfilingPool]=(ServerResourceInfo[ProfilingPool]=(state=rolledback,ass
          igned=myserver),xar=ProfilingPool),SCInfo[mydomain+myserver]=(state=rolledback),local
          properties=({}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.41.0.61:7001+m
          ydomain+t3+, XAResources={JMS_myJmsStore, JMS_FileStore, ProfilingPool, SearchManagementPool,
          AnnouncementsTxPool},NonXAResources={})],CoordinatorURL=myserver+10.41.0.61:7001+mydomain+t3+):
          javax.tran
          saction.xa.XAException: prepare failed for XAResource 'ProfilingPool' with error
          XAER_NOTA : The XID is not valid
          at weblogic.jdbc.oci.xa.XA.createException(XA.java:386)
          at weblogic.jdbc.oci.xa.XADataSource.internalPrepare(XADataSource.java:905)
          at weblogic.jdbc.oci.xa.XADataSource.prepare(XADataSource.java:885)
          at weblogic.jdbc.jta.DataSource.prepare(DataSource.java:846)
          at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:1167)
          at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:401)
          at weblogic.transaction.internal.ServerSCInfo$1.execute(ServerSCInfo.java:253)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          --------------- nested within: ------------------
          weblogic.transaction.RollbackException: Could not prepare resource 'ProfilingPool
          prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID is
          not valid - with nested exception:
          [javax.transaction.xa.XAException: prepare failed for XAResource 'ProfilingPool'
          with error XAER_NOTA : The XID is not valid]
          at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1644)
          at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:300)
          at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
          at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
          at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
          at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
          at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
          at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          2004-03-23 15:00:45,406 ERROR IS003989 [ExecuteThread: '17' for queue: 'ProfileCompleteListenerBean.ExecuteQueue']
          my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:350
          ) - Failed to update profiling status for holding 10014 [] (-2)
          java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for
          lock
          at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
          at weblogic.jdbc.oci.PreparedStatement.executeUpdate(PreparedStatement.java:226)
          at weblogic.jdbc.oci.xa.PreparedStatement.executeUpdate(PreparedStatement.java:81)
          at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
          at my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:345)
          at my.package.search.business.ProfilingManager.disseminateAndAcknowledge(ProfilingManager.java:254)
          at my.package.search.business.ProfileCompleteListenerBean.onMessage(ProfileCompleteListenerBean.java:128)
          at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
          at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
          at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
          at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
          at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          2004-03-23 15:01:43,093 ERROR IS003989 [ExecuteThread: '18' for queue: 'HoldingStatusListenerBean.ExecuteQueue']
          my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:265)
          - Failed to retrieve profiling results for holding 10060 [] (-2)
          java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction
          189.47.12
          at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
          at weblogic.jdbc.oci.PreparedStatement.executeQuery(PreparedStatement.java:152)
          at weblogic.jdbc.oci.xa.PreparedStatement.executeQuery(PreparedStatement.java:48)
          at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:80)
          at my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:256)
          at my.package.search.business.ProfiledHoldingDAO.storeHoldingMetadata(ProfiledHoldingDAO.java:489)
          at my.package.search.business.ProfiledHoldingDAO.storeNewHolding(ProfiledHoldingDAO.java:406)
          at my.package.search.business.ProfilingManager.profileHolding(ProfilingManager.java:128)
          at my.package.search.business.HoldingStatusListenerBean.onMessage(HoldingStatusListenerBean.java:121)
          at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
          at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
          at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
          at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
          at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
          at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          

Hi. There is a serious bug in the Oracle DBMS (all versions) where in-doubt
          transactions have their data locked in the DBMS by page rather than by row,
          so it will indefinitely prevent access to all data on the page, including
          logically uninvolved data. Oracle understands the problem but currently
          says they will never fix it (it would take too much work). They offer the
          alternative that you configure your table data to ensure that no more than
          one datarow resides on a page.
          Joe
          Matt Smith wrote:
          > I've developed an MDB that reads a message from a queue, performs database updates
          > against up to 2 databases, and sends an outgoing JMS message when all is complete.
          > The MDB uses container-managed transactions to ensure that all DB updates and
          > JMS messages are committed or rolled back together. I have had a lot of problems
          > related to transactions failing, becoming "in-doubt" in the database and locking
          > database resources indefinitely.
          >
          > My environment is configured as follows:
          > WebLogic 8.1.2 Server
          > Oracle 9.2.0.4 database with RAC
          > XA Connection Pool with WebLogic Type 2 Oracle Driver OR Oracle 9.2.0.4
          > OCI Driver
          >
          > I have read the BEA/HP white paper regarding Weblogic 8.1 with Oracle 9i RAC (http://dev2dev.bea.com/products/wlserver81/whitepapers/wls_bea_hp.jsp)
          > and have tried all of the solutions suggested in that paper. The only solution
          > that worked consistently without causing the in-doubt transactions was to change
          > my connection pools to point directly to a single node of the RAC cluster, not
          > to the shared instance. However, even with this configuration, I have seen these
          > errors occur when certain database failures occur.
          >
          > A side-effect of this problem is that the associated WebLogic connection pools
          > begin to "forget" connections. The pool thinks that all of the connections are
          > in use (even though I am always calling Statement.close() and Connection.close()),
          > and the connection pool cannot be reset manually. The only way to clear the connection
          > pool is to bounce WebLogic.
          >
          > The only posts I have found related to this error were regarding Oracle 8.1.7
          > and WebLogic 6.1. Any help would be greatly appreciated.
          >
          > Exceptions:
          > -----------------
          > <Mar 23, 2004 2:59:36 PM EST> <Error> <EJB> <BEA-010026> <Exception occurred during
          > commit of transaction Xid=BEA1-0526A28664707F28EDB9(6412513),Status=Rolled back.
          > [Reason=javax.transaction.xa.XAException
          > : prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID
          > is not valid],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds
          > left=60,XAServerResourceInfo[JMS_my
          > JmsStore]=(ServerResourceInfo[JMS_myJmsStore]=(state=rolledback,assigned=myserver),xar=JMS_myJmsStore),XAServerResourceInfo[ProfilingPool]=(ServerResourceInfo[ProfilingPool]=(state=rolledback,ass
          > igned=myserver),xar=ProfilingPool),SCInfo[mydomain+myserver]=(state=rolledback),local
          > properties=({}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=myserver+10.41.0.61:7001+m
          > ydomain+t3+, XAResources={JMS_myJmsStore, JMS_FileStore, ProfilingPool, SearchManagementPool,
          > AnnouncementsTxPool},NonXAResources={})],CoordinatorURL=myserver+10.41.0.61:7001+mydomain+t3+):
          > javax.tran
          > saction.xa.XAException: prepare failed for XAResource 'ProfilingPool' with error
          > XAER_NOTA : The XID is not valid
          > at weblogic.jdbc.oci.xa.XA.createException(XA.java:386)
          > at weblogic.jdbc.oci.xa.XADataSource.internalPrepare(XADataSource.java:905)
          > at weblogic.jdbc.oci.xa.XADataSource.prepare(XADataSource.java:885)
          > at weblogic.jdbc.jta.DataSource.prepare(DataSource.java:846)
          > at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:1167)
          > at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerResourceInfo.java:401)
          > at weblogic.transaction.internal.ServerSCInfo$1.execute(ServerSCInfo.java:253)
          > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          > --------------- nested within: ------------------
          > weblogic.transaction.RollbackException: Could not prepare resource 'ProfilingPool
          > prepare failed for XAResource 'ProfilingPool' with error XAER_NOTA : The XID is
          > not valid - with nested exception:
          > [javax.transaction.xa.XAException: prepare failed for XAResource 'ProfilingPool'
          > with error XAER_NOTA : The XID is not valid]
          > at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1644)
          > at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:300)
          > at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
          > at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
          > at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
          > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
          > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
          > at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
          > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          > ...
          > 2004-03-23 15:00:45,406 ERROR IS003989 [ExecuteThread: '17' for queue: 'ProfileCompleteListenerBean.ExecuteQueue']
          > my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:350
          > ) - Failed to update profiling status for holding 10014 [] (-2)
          > java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for
          > lock
          > at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
          > at weblogic.jdbc.oci.PreparedStatement.executeUpdate(PreparedStatement.java:226)
          > at weblogic.jdbc.oci.xa.PreparedStatement.executeUpdate(PreparedStatement.java:81)
          > at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:94)
          > at my.package.search.business.ProfiledHoldingDAO.setProfilingStatus(ProfiledHoldingDAO.java:345)
          > at my.package.search.business.ProfilingManager.disseminateAndAcknowledge(ProfilingManager.java:254)
          > at my.package.search.business.ProfileCompleteListenerBean.onMessage(ProfileCompleteListenerBean.java:128)
          > at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
          > at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
          > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
          > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
          > at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
          > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          > ...
          > 2004-03-23 15:01:43,093 ERROR IS003989 [ExecuteThread: '18' for queue: 'HoldingStatusListenerBean.ExecuteQueue']
          > my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:265)
          > - Failed to retrieve profiling results for holding 10060 [] (-2)
          > java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction
          > 189.47.12
          > at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:282)
          > at weblogic.jdbc.oci.PreparedStatement.executeQuery(PreparedStatement.java:152)
          > at weblogic.jdbc.oci.xa.PreparedStatement.executeQuery(PreparedStatement.java:48)
          > at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:80)
          > at my.package.search.business.ProfiledHoldingDAO.getProfilingStatus(ProfiledHoldingDAO.java:256)
          > at my.package.search.business.ProfiledHoldingDAO.storeHoldingMetadata(ProfiledHoldingDAO.java:489)
          > at my.package.search.business.ProfiledHoldingDAO.storeNewHolding(ProfiledHoldingDAO.java:406)
          > at my.package.search.business.ProfilingManager.profileHolding(ProfilingManager.java:128)
          > at my.package.search.business.HoldingStatusListenerBean.onMessage(HoldingStatusListenerBean.java:121)
          > at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
          > at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
          > at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
          > at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
          > at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
          > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
          > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
          >
          >
          

Similar Messages

  • Lock held by in-doubt distributed transaction

              I'm having an intermittent problem in our server where a distributed transaction
              between WebLogic JMS (6.1 sp3) and Oracle (using the 9.1.2 XA driver) doesn't
              complete and subsequent attempts to access the rows in question result in:
              java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction
              4.33.52658
              Has anybody else seen anything like this?
              

              Rao,
              The BEA patch is CR095835_610SP4. Apparently there is a corresponding patch for
              SP3 as well. When configuring the jdbc connection pool set XaSetTransactionTimeout
              = true and
              XaTransactionTimeout = yourTimeoutValueInSeconds. This will instruct the Transaction
              manager to set the timeout value on Oracle's XAResource during the two-phase commit
              process. I believe Oracle refers to the timeout value as SesTm.
              Cheers,
              Tony
              "Rao Boppana" <[email protected]> wrote:
              >
              >We are currently facing the same problem. Could you let us know more
              >details about
              >the patch BEA put out to fix this? Is there a patch #/bug #? We are currently
              >running SP4, Oracle 9.2.3 using 9.2.0.1 drivers. We really cannot set
              >our JTA
              >timeout to less than 1 minute and hence we are left with option2. Any
              >help would
              >be greatly appreciated.
              >
              >
              >"Tony Necakov" <[email protected]> wrote:
              >>
              >>Jane,
              >>Thanks for the reply. After talking to Oracle support, we believe we've
              >>discovered
              >>the cause of the problem. Apparently, setting the JTA transaction timeout
              >>does
              >>not affect the default timeout from Oracle's point of view. Consequently,
              >> XA
              >>transactions exceeding 1 minute (Oracle's default) were being marked
              >>by Oracle
              >>as in-doubt. Subsequent commits or rollback from the transaction manager
              >>were
              >>being ignored. The solution is to either knock the JTA timeout value
              >>to something
              >>below Oracle's default or install a BEA patch which allows the transaction
              >>manager
              >>to set the timeout on the Oracle resource manager.
              >>
              >>"Jane Sampson" <[email protected]> wrote:
              >>>Hi Tony,
              >>>
              >>>Yes, I believe there were some problems with 8.1.7. I believe it requires
              >>>an Oracle patch AND a JDriver patch (if you are using the WebLogic
              >JDriver).
              >>>Open a case with support for details.
              >>>
              >>>Thanks,
              >>>
              >>>Jane
              >>>BEA Support
              >>>
              >>>
              >>>"Tony Necakov" <[email protected]> wrote in message
              >>>news:[email protected]...
              >>>>
              >>>> We're seeing the same intermittent problem with Oracle 8.1.7.2 and
              >>>8.1.7.4. The
              >>>> problem occurs with WLS 6.1 service pack 3 and service pack 4.
              >>>>
              >>>> "Jane Sampson" <[email protected]> wrote:
              >>>> >Hi Tim,
              >>>> >
              >>>> >There is an issue has been reported for Oracle 9.2.0.1 Database/Oracle
              >>>> >9.2.0.1 Thin Driver and exhibits this behavior and is being address
              >>>by
              >>>> >both
              >>>> >BEA and Oracle. I would suggest you open a case with Customer Support
              >>>> >and
              >>>> >mention CR090816. It could be the same problem.
              >>>> >
              >>>> >Thanks,
              >>>> >
              >>>> >Jane
              >>>> >BEA Support
              >>>> >
              >>>> >"Tim Dawson" <[email protected]> wrote in message
              >>>> >news:[email protected]...
              >>>> >>
              >>>> >> I'm having an intermittent problem in our server where a distributed
              >>>> >transaction
              >>>> >> between WebLogic JMS (6.1 sp3) and Oracle (using the 9.1.2 XA
              >driver)
              >>>> >doesn't
              >>>> >> complete and subsequent attempts to access the rows in question
              >>>result
              >>>> >in:
              >>>> >>
              >>>> >> java.sql.SQLException: ORA-01591: lock held by in-doubt distributed
              >>>> >transaction
              >>>> >> 4.33.52658
              >>>> >>
              >>>> >> Has anybody else seen anything like this?
              >>>> >
              >>>> >
              >>>>
              >>>
              >>>
              >>
              >
              

  • ORA-01591: lock held by in-doubt distributed transaction 14.4.44

    Hi,
    I am using WLI 8.1 SP2 on Windows 2000, Oracle 9.2. I am getting this error...
    <Apr 23, 2004 10:43:43 AM EDT> <Error> <WLW> <000000> <error
    java.io.IOException: [BEA][Oracle JDBC Driver][Oracle]ORA-01591: lock held by
    in
    -doubt distributed transaction 14.4.44
    at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
    at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
    at com.bea.wlw.runtime.core.bean.BMPContainerBean$OracleTableAccess.doSt
    oreByInsert(BMPContainerBean.java:904)
    at com.bea.wlw.runtime.core.bean.BMPContainerBean.doInsert(BMPContainerB
    ean.java:1785)
    at com.bea.wlw.runtime.core.bean.BMPContainerBean.ejbStore(BMPContainerB
    ean.java:1742)
    at com.bea.wli.bpm.runtime.ProcessContainerBean.ejbStore(ProcessContaine
    rBean.java:79)
    at com.bea.wlwgen.PersistentContainer_nga2bb_Impl.ejbStore(PersistentCon
    tainer_nga2bb_Impl.java:149)
    at weblogic.ejb20.manager.ExclusiveEntityManager.beforeCompletion(Exclus
    iveEntityManager.java:556)
    at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
    er.java:745)
    at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
    erSCInfo.java:1010)
    at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
    rverSCInfo.java:115)
    at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
    dChain(ServerTransactionImpl.java:1142)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
    ServerTransactionImpl.java:1868)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
    rverTransactionImpl.java:250)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
    sactionImpl.java:221)
    at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
    at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.
    java:316)
    at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    I have tried dropping all wli tables & deleting tlog files (deleting everything
    from cgServer directory). Still get this error.
    Any suggestions??
    TIA
    -Amit

    Getting this problem with WLI. I have just truncated tables and it's fine now.
    Thanks,
    Amit
    "Sheetal Jain" <[email protected]> wrote:
    >
    Amit,
    If these problem is happening with the WLI database then I would suggest
    you should
    talk to BEA support. If it is happening in the application you have built
    just
    look for any deadlock conditions happening in some scenarios inside different
    inter-related transactions running at the same time, I mean transaction
    1 is locking
    something and in the meantime another one B locks something else which
    is required
    for the transaction A to move farward and now second one needs the resource
    locked
    by 1st.
    Hope this helps
    "Nagraj Rao" <[email protected]> wrote:
    Hello Amit !,
    Lock From In-Doubt Transaction is a 2-p TX issue, A query or DML statement
    that
    requires locks on a database is probably blocked due to some lock held
    by a resource
    of an "in-doubt distributed transaction".
    A DB Admin can manually Commit or Rollback an "in-doubt distributedtransaction".
    So I suggest you talk to the DBA
    More at : http://www-rohan.sdsu.edu/doc/oracle/server803/A54653_01/ds_ch3.htm
    BTW here's what Oracle says :
    ORA-01591 lock held by in-doubt distributed transaction string
    Cause: An attempt was made to access resource that is locked by a dead
    two-phase
    commit transaction that is in prepared state.
    Action: The database administrator should query the PENDING_TRANS$ and
    related
    tables, and attempt to repair network connection(s) to coordinator and
    commit
    point. If timely repair is not possible, the database administratorshould
    contact
    the database administrator at the commit point if known or the end user
    for correct
    outcome, or use heuristic default if given to issue a heuristic COMMIT
    or ABORT
    command to finalize the local portion of the distributed transaction.
    "Sheetal Jain" <[email protected]> wrote:
    Amit,
    It could be a bug. Open a ticket with BEA and see if they have a patch.
    "Amit Bhutra" <[email protected]> wrote:
    Hi,
    I am using WLI 8.1 SP2 on Windows 2000, Oracle 9.2. I am getting
    this
    error...
    <Apr 23, 2004 10:43:43 AM EDT> <Error> <WLW> <000000> <error
    java.io.IOException: [BEA][Oracle JDBC Driver][Oracle]ORA-01591: lock
    held by
    in
    -doubt distributed transaction 14.4.44
    at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
    at weblogic.jdbc.base.BaseBlobOutputStream.write(Unknown Source)
    at com.bea.wlw.runtime.core.bean.BMPContainerBean$OracleTableAccess.doSt
    oreByInsert(BMPContainerBean.java:904)
    at com.bea.wlw.runtime.core.bean.BMPContainerBean.doInsert(BMPContainerB
    ean.java:1785)
    at com.bea.wlw.runtime.core.bean.BMPContainerBean.ejbStore(BMPContainerB
    ean.java:1742)
    at com.bea.wli.bpm.runtime.ProcessContainerBean.ejbStore(ProcessContaine
    rBean.java:79)
    at com.bea.wlwgen.PersistentContainer_nga2bb_Impl.ejbStore(PersistentCon
    tainer_nga2bb_Impl.java:149)
    at weblogic.ejb20.manager.ExclusiveEntityManager.beforeCompletion(Exclus
    iveEntityManager.java:556)
    at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManag
    er.java:745)
    at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(Serv
    erSCInfo.java:1010)
    at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(Se
    rverSCInfo.java:115)
    at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAn
    dChain(ServerTransactionImpl.java:1142)
    at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(
    ServerTransactionImpl.java:1868)
    at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
    rverTransactionImpl.java:250)
    at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
    sactionImpl.java:221)
    at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
    at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.
    java:316)
    at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
    at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    I have tried dropping all wli tables & deleting tlog files (deleting
    everything
    from cgServer directory). Still get this error.
    Any suggestions??
    TIA
    -Amit

  • ORA-01591: lock held by in-doubt distributed transaction

    I am using oracle wcf adapter to connect to oracle to insert.
    I am getting the ORA-01591: lock held by in-doubt distributed transaction.
    Any ideas as to what could be the resolution. I have followed the below mentioned steps. but that's not a permanent solution.
    Please advice.
    The resolution described below is not acceptable and never should have been used.  Although it does avoid the error, it's not okay to turn off AmbientTransaction when performing inserts
    and/or updates.  A different solution needs to be found.<o:p></o:p>
    http://msdn.microsoft.com/en-US/library/dd788352(v=BTS.10).aspx <o:p></o:p>
    "Not performing operations in a transactional context is advisable only for operations that do not make changes to the database. For operations that update data in the database, we recommend
    setting the binding property to true otherwise you might either experience message loss or duplicate messages depending on whether you are performing inbound or outbound operations."<o:p></o:p>
    ********************************************<o:p></o:p>
    This can be resolved by adjusting the configuration settings on the Oracle adapter, accessible via the Send Port properties.  The properties and the values that should be used are shown below:<o:p></o:p>
    ** Binding tab:
    incrPoolSize:  1
    maxPoolSize:  10
    useAmbientTransaction:  False<o:p></o:p>
    ** Messages tab:
    Isolation Level:  ReadCommitted<o:p></o:p>
    Also, you'll need to get a DBA to rollback the hanging "in-doubt" transactions, which will be viewable via the sql below.  Otherwise, if you try processing the same data again, you'll
    still get the same error.<o:p></o:p>
    SELECT LOCAL_TRAN_ID, GLOBAL_TRAN_ID, STATE, MIXED, HOST, COMMIT# FROM DBA_2PC_PENDING;<o:p></o:p>
    The transactions can be rolled back with sql, using this syntax:<o:p></o:p>
    ROLLBACK FORCE '<LOCAL_TRAN_ID>';
    <o:p></o:p>
    Thank you and have great day! Vivek Kulkarni MCAD.net

    Hi Vivek,
    This error is encountered by many DBA's and cause problem by locking the distributed transaction process, and not letting the query go through, because the Two - Phase Commit Mechanism got an error somewhere.
    he DBA should query the pending_trans$ and related tables, and attempt to repair network connection(s) to coordinator and commit point.
    Here are some codes to help you through the process:
    This one brings in-doubt transactions:
    select * from DBA_2PC_PENDING where state='prepared'
    This one prepares the rollback script for the transactions:
    select 'rollback force '''||local_tran_id||''';' from DBA_2PC_PENDING where state='prepared'
    All this is well described in below link
    ORA-01591: lock held by in-doubt distributed transaction
    ORA-01591: lock held by in-doubt distributed transaction string tips
    On BizTalk Side you need to make ambient transaction to false as Oracle does not go ahead with DTC Transaction with  Biz Talk
    Thanks
    Abhishek

  • ERROR:ORA-01591: lock held by in-doubt distributed transaction (URGENT)

    hi
    i m having this error when trying to access one table in oracle 10g database
    ORA-01591: lock held by in-doubt distributed transaction 3.30.4119
    i restarted the server but of no use. can anyone help?

    ORA-01591: lock held by in-doubt distributed transaction string
    Cause: Trying to access resource that is locked by a dead two-phase commit transaction that is in prepared state.
    Action: DBA should query the pending_trans$ and related tables, and attempt to repair network connection(s) to coordinator and commit point. If timely repair is not possible, DBA should contact DBA at commit point if known or end user for correct outcome, or use heuristic default if given to issue a heuristic commit or abort command to finalize the local portion of the distributed transaction.
    go through
    drop locked table
    plz. to through below i hope it will help u.
    Re: ORA-1591 error
    Message was edited by:
    user52

  • Ora-01591 Lock held in by In-doubt distributed transaction - help required

    In my web application i am getting an error @ a particular page. I am using JTA user transaction to mark the transaction boundaries. On commit i am confronting the error "lock held in by In-Doubt transaction. I queried pending_trans$,dba_2pc_pending and force commit the transaction.Also i purged the transaction using Purge_Lost_db_entity. Still after doing all these i am facing the same problem with a new transaction no.
    I did all the below steps:
    I did follow the below steps:
    SELECT * FROM PENDING_TRANS$
    SELECT
    LOCAL_TRAN_ID, GLOBAL_TRAN_ID, STATE, MIXED, HOST, COMMIT#
    FROM
    DBA_2PC_PENDING
    WHERE
    LOCAL _TRAN_ID = '??.';
    SELECT LOCAL_TRAN_ID, IN_OUT, DATABASE, INTERFACE
    FROM DBA_2PC_NEIGHBORS;
    COMMIT FORCE 'local transactionID', 'SCN';
    DBMS_TRANSACTION.PURGE_LOST_DB_ENTRY (local transactionID); OR
    DBMS_TRANSACTION.PURGE_MIXED (local transactionID);
    SELECT s.inst_id,
    s.sid,
    s.serial#,
    p.spid,
    s.username,
    s.program
    FROM gv$session s
    JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
    WHERE s.type != 'BACKGROUND'
    and s.program='JDBC Thin Client'
    ALTER SYSTEM KILL SESSION '102,10' IMMEDIATE;
    Database shutdown and restart doesnt work..
    Please anyone help..

    tis is the result of the query v$version
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    "CORE 10.2.0.3.0 Production"
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    I use websphere6.1 and oracle 10.2.0.3. using JTA UserTransaction to define boundaries. I am facing tis issue from last week only before it was working fine. I did the commit force as mentioned before to manually unlock transaction.From then i am getting this error. Could u pls help. I m having pressure from onsite, i dont know what is causing the error in one particular flow. I have included the error logs below.
    [7/14/10 19:15:54:328 IST] 00000023 WSRdbXaResour E DSRA0304E: XAException occurred. XAException contents and details are:
    The XA Error is : -3
    The XA Error message is : A resource manager error has occured in the transaction branch.
    The Oracle Error code is : 17410
    The Oracle Error message is: Internal XA Error
    The cause is : null.
    [7/14/10 19:15:54:343 IST] 00000023 WSRdbXaResour E DSRA0302E: XAException occurred. Error code is: XAER_RMERR (-3). Exception is: <null>
    [7/14/10 19:15:54:359 IST] 00000023 XATransaction E J2CA0027E: An exception occurred while invoking commit on an XA Resource Adapter from dataSource jdbc/ScorecardDataSource, within transaction ID {XidImpl: formatId(57415344), gtrid_length(36), bqual_length(54), data(00000129d13434870000000100000008f0685880e9e9a1514500185d37d88f31da70140400000129d13434870000000100000008f0685880e9e9a1514500185d37d88f31da701404000000010000000000000000000000000001)}: oracle.jdbc.xa.OracleXAException
    [7/14/10 19:15:54:531 IST] 00000023 MCWrapper E J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection WSRdbManagedConnectionImpl@3e0a3e0a from resource jdbc/ScorecardDataSource. Caught exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: No more data to read from socket. with SQL State : null SQL Code : 17410
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
    [7/14/10 19:15:54:593 IST] 00000023 MCWrapper E J2CA0081E: Method destroy failed while trying to execute method destroy on ManagedConnection WSRdbManagedConnectionImpl@3e0a3e0a from resource No longer available. Caught exception: java.lang.NullPointerException
    [7/14/10 19:16:08:093 IST] 00000023 SystemErr R Caused by: java.sql.SQLException: ORA-01591: lock held by in-doubt distributed transaction 9.34.890
    Pls help

  • ORA-01591: lock held by in-doubt distributed transaction 2.53.300807

    SQL> select count(*) from TBCD_CCODMSG;
    select count(*) from TBCD_CCODMSG
    ERROR at line 1:
    ORA-01591: lock held by in-doubt distributed transaction 2.53.300807
    SQL> select * from TBCD_CCODMSG where rownum =10;
    select * from TBCD_CCODMSG where rownum =10
    ERROR at line 1:
    ORA-01591: lock held by in-doubt distributed transaction 2.53.300807
    SQL> alter session set events '1591 trace name errorstack level 10';
    Session altered.
    SQL> select * from TBCD_CCODMSG where rownum =10;
    select * from TBCD_CCODMSG where rownum =10
    ERROR at line 1:
    ORA-01591: lock held by in-doubt distributed transaction 2.53.300807
    SQL> select object_name, object_type from user_objects where object_name = 'TBCD_CCODMSG';
    OBJECT_NAME
    OBJECT_TYPE
    TBCD_CCODMSG
    TABLE
    SQL> select * from DBA_2PC_PENDING;
    no rows selected
    SQL> select * from DBA_2PC_NEIGHBORS where local_tran_id = '2.53.300807';
    LOCAL_TRAN_ID IN_
    DATABASE
    DBUSER_OWNER I DBID SESS#
    BRANCH
    2.53.300807 in
    EFT.WORLD
    CD1 N 15f1353d 1
    0B000B00011902000128

    보통은 오라클 Background 프로세스인 RECO 프로세스가
    해당 문제를 자동으로 복구해줍니다.
    하지만, 가끔씩 제대로 처리를 못해주는 경우는 DBA 가 아래 절차를 확인하여
    수동으로 처리를 해줘야 하는 경우도 있습니다.
    아래 내용을 참고하세요...
    No. 12163
    DISTRIBUTED TRANSACTION TROUBLESHOOTING (ORA-1591해결 방법)
    ==========================================================
    다른 database를 이용하지 않는 local transaction이, 비정상 종료시 자동으로
    rollback되는 것과는 달리, 분산 트랜잭션의 경우 2 phase commit수행 단계중에
    fail이 발생하게 되면 관여된 일부 database에서는 rollback 혹은 commit이 되고,
    일부는 distributed lock이 걸린 상태로 계속 지속될 수 있다.
    이렇게 pending된 transaction에 대해서는 기본적으로 Oracle의 background
    process인 RECO process가 자동으로 정리하여 주나, 경우에 따라 자동으로 정리가
    되지 못하는 상황이 발생할 수 있다.
    이렇게 정리가 되지 않아, distributed lock이 걸린 경우에는, 이후 관계된
    table을 조회나 변경시 ora-1591 오류가 발생할 수 있으므로, distributed
    transaction이 실패한 경우 db admin이 관여하여 pending된 transaction을
    정리하여 줄 필요가 있다.
    distributed transaction이 오류가 발생하거나, 혹은 이후에 ora-1591이 발생하는
    경우, 조치 방법을 9단계의 STEP으로 정리하였다.
    *** distributed transaction의 2 phase commit에 대한 개념 및 자세한 절차는
    <korean bulletin:12185>를 참조한다.
    [참고 1] 문서의 이해를 위해서 분산 환경에 포함된 node를 V817LOC와 V817REM으로
    예를 들고, V817LOC node에서 transaction을 수행하였다고 가정한다.
    [참고 2] 아래에 언급되는 dbms_transaction package는 기본적으로 catproc.sql
    script에 의해 생성되나 만약 존재하지 않는다면,
    cd $ORACLE_HOME/rdbms/admin directory의 dbmsutil.sql, prvtutil.plb
    script를 sys user에서 수행하도록 한다.
    (svrmgrl에서 connect internal에서 수행하는것이 일반적)
    그리고 이 package는 항상 transaction의 맨 처음에 수행되어야 한다.
    즉, 새로 session을 연결하여 수행하거나, 혹은 앞에 dml에 있었다면,
    commit이나 rollback을 수행 후 이 package를 수행하여야 한다.
    아래의 STEP중 STEP 1 ~ 3까지는 문제 해결을 위해 필수적인 단계는 아니므로 바로
    문제를 시급히 해결해야 하는 경우 4번부터 확인하도록 한다.
    STEP 1: alert.log file을 check한다.
    bdump directory의 alert.log에는 분산 트랜잭션 fail시 관계된 오류 메시지등
    log가 항상 남게 된다. 예를 들면 다음과 같은 형태인데, rollback/commit되었
    는지, in-doubt 상태인지와 그 외에 transaction id등 정보를 확인할 수 있다.
    Tue Dec 12 16:23:25 2000
    ORA-02054: transaction 1.8.238 in-doubt
    ORA-02063: preceding line from V817REM
    Tue Dec 12 16:23:25 2000
    DISTRIB TRAN V817LOC.WORLD.89f6eafb.1.8.238
    is local tran 1.8.238 (hex=01.08.ee)
    insert pending prepared tran, scn=194671 (hex=0.0002f86f)
    STEP 2: network 환경을 확인한다.
    listener가 떠 있는지, database link가 모두 정상적인지 확인해 본다.
    STEP 3: RECO process가 떠 있는지 확인한다.
    os상에서 RECO process가 떠 있는지 확인하려면 다음과 같이 한다.
    os> ps -ef | grep reco
    RECO process는 db가 startup되면서 자동으로 구동되는 background process로
    distributed recovery를 disable시키면 사라지게 된다. distributed recovery를
    enable/disable시키는 방법은 아래와 같다.
    SQL>alter system enable distributed recovery;
    SQL>alter system disable distributed recovery;
    아래의 조치사항 중에서 STEP 9번을 제외하고는 기본적으로 RECO process가
    자동으로 처리하는 작업과 동일하다. 그러나 여러가지 문제로 인해 RECO가
    자동으로 정리하지 못한 경우 이 문서의 방법대로 manual하게 정리하여 주어야
    한다.
    STEP 4: DBA_2PC_PENDING을 조회해 본다.
    sqlplus system/manager
    SQL>select local_tran_id, global_tran_id, state, mixed, host, commit#
    from dba_2pc_pending;
    다음과 같은 결과가 return된다.
    LOCAL_TRAN_ID|GLOBAL_TRAN_ID |STATE |MIX|HOST |COMMIT#
    -------------|----------------------|--------|---|----------|--------
    1.8.238 |V817LOC.WORLD.89f6eafb|prepared|no |SUP_SERVER|194671
    |.1.8.238 | | |\eykim |
    이 조회로 인해 여러개의 row가 나오는 경우 ora-1591이나 distributed fail에
    관련된 오류시 나타나는 local transaction id값과 return된 LOCAL_TRAN_ID값을
    비교하여 일치하는 row를 확인하면 된다. 이때 LOCAL_TRAN_ID 값과
    GLOBAL_TRAN_ID의 뒷부분의 숫자가 동일하다면 이것은 이 node가 global
    coordinator임을 의미한다.
    STEP 5: DBA_2PC_NEIGHBORS view를 조회해 본다.
    sqlplus system/manager
    SQL>select local_id, in_out, database, dbuser_owner, interface
    from dba_2pc_neighbors;
    LOCAL_TRAN_ID|IN_OUT|DATABASE |DBUSER_OWNER |INT
    -------------|------|-------------------------|---------------|---
    1.8.238 |in | |SCOTT |N
    1.8.238 |out |V817REM.WORLD |SCOTT |C
    여기에 나타난 row들이 해당 분산 트랜잭션에 관여한 database 정보이다. 이때
    DATABASE column 부분이 null로 나타나는 것은 현재 조회하고 있는 local
    database를 의미하며, IN_OUT이 OUT으로 나타나는 경우 참조하는 node정보인데,
    DATABASE 컬럼의 값이 해당 database를 가리키는 database link name이 된다.
    이 database link name을 이용하여 다음과 같이 remote db의 DBA_2PC_PENDING을
    다시 조사하여 관계된 node들의 상태를 확인할 수 있다.
    SQL>select local_tran_id, global_tran_id, state, mixed, host, commit#
    from dba_2pc_pending@v817rem;
    각 node의 DBA_2PC_PENDING의 return된 row들이 같은 분산 트랜잭션에 포함된
    정보인지는 GLOBAL_TRAN_ID 값을 이용하여 확인할 수 있다.
    STEP 6: commit point site를 확인한다.
    commit point site에 대해서는 <korean bulletin:12185>을 참조한다.
    이 예의 경우 COMMIT_POINT_STRENGTH를 지정하지 않았기 때문에 default로
    global coordinator가 아닌 V817REM이 commit point site가 된다. 일반적으로
    commit point site는 global coordinator의 DBA_2PC_NEIGHBORS의 IN_OUT
    field가 OUT으로 나타나고 INTERFACE 부분이 C로 나타나게 된다.
    commit point site가 중요한 이유는 이 node의 local transaction부분은
    prepared상태를 거치지 않아 in-doubt 상태가 되는 일이 없고, 그러므로
    distributed lock에 의해 조회나 DML시 오류가 발생하는 없게 된다.
    이러한 이유로 제일 중요한 data를 포함하는 중심이 되는 node를 commit point
    site로 지정하는 것이 바람직하다.
    STEP 7: DBA_2PC_PENDING의 MIXED column을 확인한다.
    - MIXED값이 NO인 경우 : STEP 8 수행
    - MIXED값이 YES인 경우: STEP 9 수행
    DBA_2PC_PENDING에서 MIXED column을 YES나 NO의 값으로 지정하는 것은 RECO
    process가 결정하여 변경하게 된다. MIXED가 YES가 되는 대표적인 경우는,
    commit point site가 이미 commit을 수행한 상태에서 분산 트랜잭션이 fail된
    경우, non-commit point site에서 prepared 상태의 transaction을 rollback
    force시켜 분산 트랜잭션의 consistency가 깨진 상태이다.
    (STATE column의 경우 commit point site는 COMMITTED로 non-commit point
    site는 FORCED ROLLBACK으로 나타난다)
    [참고] commit point site가 아직 commit을 수행하기 전에 분산 트랜잭션이
    fail되어 commit point site가 rollback된 경우, non-commit point
    site에서 prepared 상태의 transaction을 commit force 하면 이것도
    논리적으로는 consistency가 지켜지지 않은 것은 동일하나 이때는
    MIXED column이 no인 상태가 된다. 그 이유는 commit point site가
    rollback되어 DBA_2PC_PENDING view에 entry가 남지 않기 때문에
    RECO가 명시적으로 mixed 상태로 인식하는 것이 불가능하기 때문으로
    파악된다.
    STEP 8: DBA_2PC_PENDING의 STATE column의 값을 확인한다.
    CASE 8-1: STATE field값이 COMMITTED인 경우
    만약 STATE가 COMMITTED인 경우는 이 local database(V817LOC)에서는
    transaction이 성공적으로 commit 되었음을 나타내므로, 이 node에서는 어떠한
    작업도 수행할 필요가 없다. 이 entry는 RECO process에 의해 자동으로 지워질
    것이며, 만약 RECO가 어떠한 이유로 이 row를 지우지 못했다면 다음과 같이
    db admin이 직접 지워도 된다. 괄호 안의 값은 local_tran_id값이다.
    sqlplus sys/manager (반드시 sys로 접속한다)
    SQL>exec dbms_transaction.purge_lost_db_entry('1.8.238');
    이렇게 V817LOC의 STATE부분이 COMMITTED인 경우는, 이미 commit point site인
    V817REM은 commit된 후임을 나타낸다. 그러므로 V817REM은 STATE가 COMMITTED로
    나타나거나 아니면 commit후 이미 정보가 지워져 DBA_2PC_PENDING에 정보가
    나타나지 않을 수 있다. 그러므로 V817REM에 대해서는 필요한 경우 V817LOC의
    앞의 조치 방법과 동일하게 DBA_2PC_PENDING의 내용만 정리하여 주면 된다.
    만약 V817REM이 아닌 별도의 다른 node가 분산 트랜잭션에 관여했다고 가정하고
    V817LOC가 COMMITTED인 상태에서 그 node의 STATE가 PREPARED로 나타난다면
    그 node에 대해서는 아래의 CASE 8-2를 참조하여 해결하도록 한다.
    CASE 8-2: STATE field값이 PREPARED인 경우
    STATE값이 PREPARED인 경우는 이 node(V817LOC)에서 변경된 data가 속한 block
    에 distributed lock이 걸린 상태이며, 이런 경우 변경된 data가 있는 block에
    대한 모든 read/write가 ora-1591을 발생시키므로 trouble shooting에서 제일
    중요한 부분이라 할 수 있다.
    먼저 STEP 4와 STEP 5를 참조하여 관계된 모든 node들의 DBA_2PC_PENDING view
    를 조회하여 본다. 이때 다른 node(V817REM)의 DBA_2PC_PENDING에 정보가 없다
    면 V817REM이 commit point site이고 이미 data는 rollback되었음을 나타낸다.
    이때는 V817LOC의 prepared 상태의 transaction을 다음과 rollback force 시켜
    준다.
    즉, V817LOC에서,
    SQL>rollback force '1.8.238';
    만약 V817REM node에 해당 정보가 있고 상태가 COMMITTED라면 V817LOC도
    다음과 같이 commit을 해 주어야 한다.
    SQL>commit force '1.8.238';
    이때 local_tran_id 뒤에 SCN을 지정할 수 있는데 이것은 관여된 node 중 제일
    큰 SCN을 지정하도록 한다. 이 SCN 값은 DBA_2PC_PENDING의 COMMIT# field에서
    값을 확인할 수 있으며 이렇게 하는 이유는 이후 분산 database중 한 database
    에서 incomplete recovery가 필요한 경우, 다른 database 들도 일관성을
    맞추기 위해 incomplete recovery를 이용할 수 있게 하기 위한 것이다.
    SQL>commit force '1.8.238', '194671'
    CASE 8-3: STATE field값이 COLLECTING인 경우
    STATE field가 collecting인 경우는 아직 distributed lock을 걸기 전단계에서
    transaction이 비정상 종료됨을 나타내며, 이 단계에서는 distributed lock이
    걸리기 전이어서 변경된 data는 이미 rollback된 상태이다. 이 경우는
    DBA_2PC_PENDING에서 해당 entry를 지워 주면 된다.
    sqlplus sys/manager (반드시 sys로 접속한다)
    SQL>exec dbms_transaction.purge_lost_db_entry('1.8.238');
    CASE 8-4: STATE field값이 FORCED ROLLBACK/FORCED COMMIT 인 경우
    이미 RECO나 db admin이 rollback force나 commit force 명령을 시도하여
    STATE가 FORCED ROLLBACK이나 FORCED COMMIT으로 변경된 경우는 추가적으로
    수행할 작업은 없으며, RECO가 자동으로 이 entry를 지워 줄 것이다. 그러나
    RECO가 작업하기를 기다리지 않고 다음과 같이 직접 삭제할 수 있다.
    sqlplus sys/manager (반드시 sys로 접속한다)
    SQL>exec dbms_transaction.purge_lost_db_entry('1.8.238');
    STEP 9: 불일치 사항을 파악하고 DBA_2PC_PENDING을 정리한다.
    어떠한 경우에 DBA_2PC_PENDING의 MIXED column이 YES가 되는지는 이미 STEP 7
    에서 설명하였다. 이렇게 잘못된 조치에 의해 STEP 7에서 설명한 것과 같은
    분산 데이타베이스간의 불일치가 발생한 경우는 간단한 operation을 통해
    일치성을 맞추는 것은 불가능하다.
    분산 트랜잭션의 consistency가 무엇보다 중요한 경우라면 관계된 node의
    database를 모두 문제의 분산 트랜잭션이 수행되기 이전 상태로, incomplete
    recovery를 수행하거나 할 수 있다. 분산 데이타베이스간의 일관성을 위한
    incomplete recovery에 대해서는 여기에서는 다루지 않는다. 한가지 언급한
    말한 것은 앞에서 설명한 분산 트랜잭션의 commit시 이용하는 commit SCN을
    관계된 모든 node들의 최대 SCN으로 이용하는 것이 바로 이러한 recovery를
    위한 것이다. 이렇게 일부 database에서 SCN값이 이전 SCN에서 1씩 증가하는
    것이 아니라 큰 값으로 건너뛰어 다른 database와 같은 SCN을 유지하게
    함으로써, 이후에 incomplete recovery시에 관계된 node들이 서로 동일한
    SCN으로 recovery를 수행하면, 모두 분산 트랜잭션 적용 이전이 되거나 혹은
    모두 이후가 되어 일관성을 유지할 수 있도록 해준다.
    MIXED가 YES인 상태에서, inconsistency를 받아들이고 DBA_2PC_PENDING view를
    정리하려면 다음과 같이 수행한다.
    sqlplus sys/manager (반드시 sys user로 수행한다)
    SQL>exec dbms_transaction.purge_mixed('1.8.238');

  • ORA-01591: lock held by in-doubt distributed transaction string  error

    Hi Gurus,
    I am getting the error
    ORA-01591: lock held by in-doubt distributed transaction string error while running once procedure.
    Procedure basically inserts 2 tables and update 1 table.
    The order of execution is given below.
    However I get the error as table _a locked.
    Can you please help me how to handle this ?
    Begin
    Insert into table_a values (values1, value2); -- (our DB)
    Insert into table_b@remote_DB values (value1, value2); --( REMOTE DB)
    update table C ; -- (our DB)
    commit; -- when I debugged I get exception with the sql error above in this commit.
    End;

    Tina wrote:
    Hi Gurus,
    I am getting the error
    ORA-01591: lock held by in-doubt distributed transaction string error while running once procedure.
    Procedure basically inserts 2 tables and update 1 table.
    The order of execution is given below.
    However I get the error as table _a locked.
    Can you please help me how to handle this ?
    Begin
    Insert into table_a values (values1, value2); -- (our DB)
    Insert into table_b@remote_DB values (value1, value2); --( REMOTE DB)
    update table C ; -- (our DB)
    commit; -- when I debugged I get exception with the sql error above in this commit.
    End;
    01591, 00000, "lock held by in-doubt distributed transaction %s"
    // *Cause:  Trying to access resource that is locked by a dead two-phase commit
    //          transaction that is in prepared state.
    // *Action: DBA should query the pending_trans$ and related tables, and attempt
    //          to repair network connection(s) to coordinator and commit point.
    //          If timely repair is not possible, DBA should contact DBA at commit
    //          point if known or end user for correct outcome, or use heuristic
    //          default if given to issue a heuristic commit or abort command to
    //          finalize the local portion of the distributed transaction.

  • ORA-01591: lock held by in-doubt distributed transaction 5.43.1205830

    ORA-01591: lock held by in-doubt distributed transaction 5.43.1205830
    ORA-06512: at "LEAP.RUN_BATCH_FROM_TABLE", line 159
    ORA-06512: at line 2
    Please kindly assist.
    Thanks+Regards
    2TOAD

    Is this one time or re-ocurring?
    Oracle, as a RM, is simply pointing out that you have an indoubt transaction, with "unknown" state after the prepare phase (2pc), that holds a resource that your batch run needs. Check dba_2pc_pending and retry your batch run.
    If problem persists then maybe it's time to investigate your distributed transaction system (is your app based on MS DTC, COM+ transactions?). You might need to manually resolve this, by forced rollback or commit.
    Use http://tahiti.oracle.com/ and search for the ORA-nnnnn string, to lookup further info about the message.
    Message was edited by:
    orafad

  • ORA-01591: lock held by in-doubt distributed transaction 206.77.12171

    I am having this type of ORA error. I have tried to look at the PENDING_TRANS$ as said in most threads but there is no record found. I have asked our DBA team if there was any locked transactio but they said that there was none. I have also read from another thread that this is a bug and there is a patch available to fix this but that patch is not available for Orace10g. By the way, I have Oracle 10g as my database.
    Anyone who have an idea to fix this? Thanks in advance

    this scenario generally arises during distributed transactions.may be transaction at the local or distributed site is not committed or roll backed.Try to commit the transaction at your side and ask the DBA at remote site to commit the transaction or roll back the transaction

  • ORA-01591: lock held by in-doubt distributed transaction string

    Hi All,
    How to find out which query is locking the table. this is what I got when I ran the below query.
    SQL> SELECT addr,KTUXEUSN, KTUXESLT, KTUXESQN, /* Transaction ID */
    2 KTUXESTA Status,
    3 KTUXECFL Flags
    4 FROM x$ktuxe
    5 WHERE ktuxesta!='INACTIVE'
    6 AND ktuxeusn=7;
    ADDR KTUXEUSN KTUXESLT KTUXESQN STATUS
    FLAGS
    5D32920C 7 35 1672382 PREPARED
    SCO|COL|REV|DEAD
    Thanks

    Here is the output:
    INST_ID SID SERIAL# STATUS
    MACHINE
    PROGRAM USED_UBLK
    HOURS_ACTIVE USED_UREC
    1 11 49014 ACTIVE
    \WSDB0335
    w3wp.exe 1
    64.295 1
    INST_ID SID SERIAL# STATUS
    MACHINE
    PROGRAM USED_UBLK
    HOURS_ACTIVE USED_UREC
    1 99 312 INACTIVE
    WSDB0335
    ORACLE.EXE 1
    64.295 1

  • ORA-01591 -- How to remove blocking distributed transaction?

    Hi at all,
    I've got a big problem! There is a transaction lock on a table and I can't access / update the table. The following error occures: ORA-01591: lock held by in-doubt distributed transaction 140.12.34934.
    So, I decided to kill this transaction. But I can't find any transaction with that number. How can I remove this transaction. A restart of the database does not kill this trransaction.
    Thanks for you help
    Message was edited by:
    user573407

    ORA-01591 lock held by in-doubt distributed transaction string
    Cause: An attempt was made to access resource that is locked by a dead two-phase commit transaction that is in prepared state.
    Action: The database administrator should query the PENDING_TRANS$ and related tables, and attempt to repair network connection(s) to coordinator and commit point. If timely repair is not possible, the database administrator should contact the database administrator at the commit point if known or the end user for correct outcome, or use heuristic default if given to issue a heuristic COMMIT or ABORT command to finalize the local portion of the distributed transaction.

  • Monitoring Distributed Transactions

    What capabilities exist in Databae 11G R2 for monitoring in doubt distributed transactions?
    Thanks,
    Bob

    If In-Doubt transactions did not automatically resolve itself (which it should), then as far as I am aware you still have to use the same views in 11g to deal with it. DBA_2PC_PENDING and DBA_2PC_NEIGHBORS.
    e.g
    SELECT global_tran_id
         , local_tran_id
         , state
         , advice 
         ,tran_comment
    FROM dba_2pc_pending
    ORDER BY local_tran_id
    /

  • 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
              >>
              >>
              >
              

  • 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

Maybe you are looking for

  • LASERJET P2015-PROBLEMS WITH PAPER FEED

    We have a HP LaserJet P2015 in the office.  When the paper reaches the halfway point, the printer makes a horrible sound and will not feed the paper.  Anybody have any suggestion?

  • Blue Ray Burners

    Ok heres the scoup , I have a Blu Ray burner on my PC and Apple has told me that when the next update comes out being Leopard I believe that is the update they are referring to. They said my Blu Ray Burner will work on my MacPro. Please advise if I w

  • Using SQLJ in Session EJB  (WebLogic 6.1) - connection giving ClassCastError

    Hi All I have one SQLJ file which i have translated to a .java file and , its contents ( methods) have ben pasted in a Session bean , which is deployed in Weblogic 6.1 App Server . Now in Session bean i am using the jndi lookup of my datasource in We

  • Oracle upgrade 10.2.0.4 to 11.2.0.2 on Prod and DR

    Hi All, We are planning to upgrade Oracle on PRD and its DR server. I have few doubts and want to clear. As we have planned. We will keep both system with Current DB and then Stop. We will upgrade Oracle software on DR site first. and then on PRD sid

  • How to transport the webdynpro applications from development production

    Hi Experts, We are implementing the first time NWDI for development. As per my knowledge . There will only NWDI available for the whole landscape to manage and track the information. NWDI will only one for the whole landscape? How do we need to trans