Distributed transaction question

I'm implementing distributed transactions between two oracle servers and am confused as to how this can work reliably. I see that I must call prepare then commit. If prepare fails then I must call rollback instead of commit. However, if I call prepare on each database and get a success from each one and then call commit the commit can throw an exception. ie:
database 1
database 2
call prepare for database 1 - success
call prepare for database 2 - success
call commit for database 1 - succes
call commit for database 2 - failure
now what? how is this beter than just calling commit not using distributed transactions? I thought that any errors for commit must be given by prepare otherwise what is the purpose of calling prepare?
Calvin R. Smith

As part of the 2PC contract, during the prepare phase, the resource manager
is required to prepare itself in such a way (e.g. acquire necessary locks,
perform necessary integrity constraint validation, do logging etc) that it
can successfully commit or rollback the transaction branch according to the
final commit/rollback call from the transaction manager. If they are unable
to prepare themselves, they are given a chance to report that early to the
transaction manager by returning an error on prepare. For the 2PC protocol
to achieve atomically, it is imperative that all resource managers take this
contract seriously.
While it is impossible to provide a completely fool-proof guarantee,
resource managers should make every effort to honor that. On rare,
catastrophic occasions where they are unable to fulfill the contract, they
are allowed to return a Heuristic error upon the subsequent commit/rollback
call issued by the transaction manager. It should be noted that heuristic
errors are considered very rare events in distributed transactions, as
compared to commit failures for local (non-XA) transactions.
Regards,
Priscilla
Calvin R. Smith <[email protected]> wrote in message
news:3be18096$[email protected]..
I'm implementing distributed transactions between two oracle servers and am
confused as to how this can work reliably. I see that I must call prepare
then commit. If prepare fails then I must call rollback instead of commit.
However, if I call prepare on each database and get a success from each one
and then call commit the commit can throw an exception. ie:
database 1
database 2
call prepare for database 1 - success
call prepare for database 2 - success
call commit for database 1 - succes
call commit for database 2 - failure
now what? how is this beter than just calling commit not using distributed
transactions? I thought that any errors for commit must be given by prepare
otherwise what is the purpose of calling prepare?
Calvin R. Smith

Similar Messages

  • Distributed Transactions - A general question

    I've been googling in hopes to find a complete example of distributed transactions in use, but everything I stumble upon seems to aim J2EE and not Java EE 5; also, most of the distributed transactions related questions here, on the forum, seem to go unanswered so this topic is starting to scare the living hell out of me.
    Anyway, all I'm trying to do is understand when distributed transactions are used and how.
    Here are my current beliefs that I need revised:
    *1* - Distributed transactions are used when:
    a) You have multiple application servers working in the same transaction.
    b) You have updates to different databases in the same transaction.
    c) You are trying to perform a database update and send or receive a JMS message in the same transaction.
    *2* - All DataSources participating in the transaction must be accessed through a XA driver
    *3* - Support for scenario a) is not mandated by Java EE specs
    Here's an additional question:
    In case of a bean manged transaction, if an EJB A calls UserTransaction.begin() and than calls a method from EJB B, does that B's UserTransaction obtained through dependency injection (@Resource private UserTransaction userTransaction) refer to A's propagated transaction (B's local method uses REQUIRES transaction attribute)?
    I would kill for a good up-to-date example on this subject, so if you know of any, please post a link or something...
    My eternal gratitude to anyone who sheds some light on this...

    I would kill for a good up-to-date example on this subject, so if you know of any, please post a link or something...The ejb3 spec has a ton of info on Transactions (Chapter 13) ad Distributed Transactions (in Chapter 15)
    [EJB 3 spec|http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html]
    You get presented with a list of three - you want to look in: ejb-3_0-fr-spec-ejbcore.pdf
    m

  • Newbie question: distributed transaction

    Hi,
    I am totally new to JMS, and have a question about distributed transaction. Can the sender and receiver both involve in the same distributed transaction? I don't think it's possible, but want to confirm here.
    The reason I ask is that I wonder if I can make use of JMS to allow Ruby on Rails app to participate in a distributed transaction.
    Any help or tips will be appreciated.
    Thanks,
    Ykng

    JMS is built around a messaging paradigm. The large majority of JMS providers will be using a broker to decouple the actions of message sending and of message receiving.
    As such, the only transactional contract that is possible is between the broker and the client (the message consumer or producer).
    When the client resides in a container (like a java app server), the client container can take the role of the transaction manager and extend the transactional aspect of the application to other participants, like a database for example.
    But in most JMS providers, that are using the broker as a "man in the middle" architectural decoupler, transactional behavior between the sender and the receiver is not possible.
    If a transactional behavior is necessary for this, then JMS is most probably the wrong solution for you.
    TE

  • Distributed transaction using linked server not working in SQL Server 2008 64 bit

    Hi. I have had an issue trying to get distributed transactions to work in SQL Server 2008 using a linked server. The error message I get is
    OLE DB provider "SQLNCLI10" for linked server "pod1" returned message "No transaction is active.".
    Msg 7391, Level 16, State 2, Line 3
    The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "pod1" was unable to begin a distributed transaction.
    My Environment:
    Windows Server 2008 Enterprise 64 bit, SQL Server 2008 Enterprise 64 bit
    Problem occurs with multiple different builds of SQL Server 2008 - I have been able to reproduce the problem with 10.0.1600.0, 10.0.1779.0 (CU 2), as well as 10.0.2531 (SP1)
    I am aware that other people have had this issue and have reviewed all existing posts. I have verified that the MSDTC is configured correctly on both machines. I have also used DTCTester to verify that DTC is working correctly on all machines in question.
    None of the mentioned resolutions has solved this problem for me.
    I am not seeing this problem occur on my 32 bit test machines - it is only occurring if at least one of the two machines is 64 bit.

    Hi All,
    I realise that this topic may be a little bit out-of-date but if someone gets here from some search engine trying to find a solution for DTC problems, this MAY be useful.
    So... I recently had the same issue, tried all the approaches described in KB and other articles, but it didn't help. Because my task to solve this was not of the highest priority I forgot about it for some time.
    Today I was troubleshooting some other issue and, by accident discovered source of that first problem:
    In the EventViewer I found Error entry logged by MSDTC saying:
    "The local MS DTC detected that the MS DTC on vm-server1 (other machine name that also runs DTC - my comment) has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate
    with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install'
    from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information."
    So I followed suggestion and run:
    msdtc -uninstall
    msdtc -install
    This solved my problems with DTC. Hope it will help someone.
    Piotr

  • ORA-02049: timeout: distributed transaction waiting for lock

    Hi,
    My name is Guneet and I'm working on an application running on BEA Weblogic Server 9.2 running on a Red Hat Linux box using Oracle 10g as the database. My problem is that recently our code started getting the following exception while updating a database table.
    java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-02049: timeout: distributed transaction waiting for lock
    Application Details
    * Using Stateless Session EJB
    * Only one Business method in this EJB with transaction attribute set to "required"
    * This method executes two select queries & one update query
    * We are using JDBC to access the database.
    * We have configured a Data Source & are using it to get a database connection.
    * Weblogic's Oracle Driver is being used.
    More details
    * The application has been running well since a month.
    * Two days ago,the update query failed with the above error.
    * At that time, a single client was accessing the system.
    * Once this problem occurs, it starts appearing frequently.
    * Eventually a request to get a connection from the Data Source times out & the exception copied at the end is thrown
    * At this stage the application gets stuck and all requests trying to get a connection end up with this exception.
    * Fortunately, Restarting the Weblogic Server gets us out of this problem and transactions resume normally.
    Now my questions are
    # Why is this error happening & what does it mean?
    # It looks like the second exception (unable to get a connection from ds) is an after effect of the first problem (ORA-02049) once it appears for a couple of times. Can somebody validate this?
    # Though I don't understand JTA well but I don't think this application needs distributed transactions so, I'm thinking of modifying the driver type to non-XA oracle driver. Any advise/pointers/comments on this front is welcome !!!!!!!!
    Thanks
    Guneet Sahai
    Exception Trace
    Dec 27, 2006 4:47:50 PM | com.gisil.themis.db | SEVERE | Unable to load merchant DEL = 911168900164. Reason - java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'themis-ds': XAER_RMERR : A resource manager error has occured in the transaction branch
    javax.transaction.xa.XAException: Unexpected error during start for XAResource 'themis-ds': Transaction timed out after 29 seconds
    BEA1-252DE51AC930078CA638
    at weblogic.jdbc.wrapper.XA.createException(XA.java:103)
    at weblogic.jdbc.jta.DataSource.start(DataSource.java:753)
    at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1182)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1115)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:274)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:497)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:429)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1408)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
    at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
    at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1413)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
    at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
    at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

    guneet sahai wrote:
    Hi,
    My name is Guneet and I'm working on an application running on BEA Weblogic Server 9.2 running on a Red Hat Linux box using Oracle 10g as the database. My problem is that recently our code started getting the following exception while updating a database table.
    java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-02049: timeout: distributed transaction waiting for lock
    Application Details
    * Using Stateless Session EJB
    * Only one Business method in this EJB with transaction attribute set to "required"
    * This method executes two select queries & one update query
    * We are using JDBC to access the database.
    * We have configured a Data Source & are using it to get a database connection.
    * Weblogic's Oracle Driver is being used.
    More details
    * The application has been running well since a month.
    * Two days ago,the update query failed with the above error.
    * At that time, a single client was accessing the system.
    * Once this problem occurs, it starts appearing frequently.
    * Eventually a request to get a connection from the Data Source times out & the exception copied at the end is thrown
    * At this stage the application gets stuck and all requests trying to get a connection end up with this exception.
    * Fortunately, Restarting the Weblogic Server gets us out of this problem and transactions resume normally.
    Now my questions are
    # Why is this error happening & what does it mean?
    # It looks like the second exception (unable to get a connection from ds) is an after effect of the first problem (ORA-02049) once it appears for a couple of times. Can somebody validate this?
    # Though I don't understand JTA well but I don't think this application needs distributed transactions so, I'm thinking of modifying the driver type to non-XA oracle driver. Any advise/pointers/comments on this front is welcome !!!!!!!!
    Thanks
    Guneet SahaiHi Guneet. If you want to debug the JTA issue, I suggest opening an official
    support case. They will lead you through producing the JTA debug information.
    However, I believe you are correct that the transaction you describe is
    completely doable with a simple local transaction, so if you were to alter
    your pool to use the non-XA driver, it would probably be faster, simpler,
    and just work.
    Let me know...
    Joe
    >
    Exception Trace
    Dec 27, 2006 4:47:50 PM | com.gisil.themis.db | SEVERE | Unable to load merchant DEL = 911168900164. Reason - java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'themis-ds': XAER_RMERR : A resource manager error has occured in the transaction branch
    javax.transaction.xa.XAException: Unexpected error during start for XAResource 'themis-ds': Transaction timed out after 29 seconds
    BEA1-252DE51AC930078CA638
    at weblogic.jdbc.wrapper.XA.createException(XA.java:103)
    at weblogic.jdbc.jta.DataSource.start(DataSource.java:753)
    at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1182)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1115)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:274)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:497)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:429)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1408)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
    at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
    at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1413)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1332)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:440)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:396)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
    at com.gisil.themis.db.impl1.DbManagerImpl.isPinValid(DbManagerImpl.java:872)
    at com.gisil.themis.ejb.ThemisBean.isPinValid(ThemisBean.java:185)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl.isPinValid(Themis_aqqc4k_EOImpl.java:207)
    at com.gisil.themis.ejb.Themis_aqqc4k_EOImpl_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

  • Unable to enlist in a distributed transaction (Windows7, Oracle 11G R1)

    Hi,
    I have a .Net application running on Windows 7 x64 using VisualStudio2008 and Oracle 11G R1 32bit client
    In it I call a webservice calling another webservice, this requires to use oramts that interfaces with Microsoft DTC. However I'm getting the following error when calling the service method:
    "Unable to enlist in a distributed transaction"
    I have checked the following:
    - Ora MTS is installed
    - DTC is running, the security settings allow AX transactions (in fact I just allowed everything)
    - Network services have the permission to access oracle dlls
    - The registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI contains the following: "OracleXaLib"="xa80.dll" "OracleSqlLib"="SQLLib80.dll" "OracleOciLib"="oci.dll" (not sure if this is right)
    What is it I'm doing wrong ? Does this version of Oracle work correctly on W7 ?
    By the way it works fine on Windows XP !
    I've spend quite some time trying to find a resolution..
    Thanks!

    I think I answered my own question
    It seems that MSDTC is not supported by Oracle 11G R1 on Windows x64 !
    All Oracle Database components are supported on Windows x64 with the following exceptions:
    •Oracle Services for Microsoft Transaction Server are not supported on Windows Vista. As a result, all Oracle Windows data access drivers on Windows Vista that use Oracle Services for Microsoft Transaction Server to enlist in Microsoft Distributed Transaction Coordinator (MSDTC) coordinated transactions cannot participate in those coordinated transactions. These data access drivers include Oracle Data Provider for .NET, Oracle Provider for OLE DB, Oracle Objects for OLE, and ODBC. Check OracleMetaLink for up to date information on Oracle Services for Microsoft Transaction Server certification with Windows Vista.
    http://download.oracle.com/docs/cd/B28359_01/install.111/b32006/reqs.htm#CHDCEFIJ
    Edited by: 845528 on 18 mars 2011 05:05

  • ORA-00164: autonomous transaction disallowed within distributed transaction

    I have been trying to solve this problem for weeks now, I have posted this question everywhere I can think of, but I havent really received and answer that has helped, so now I am going to post it here hoping for an answer.
    We are running 9iAS on Solaris and when the following stuff is run we are getting ORA-00164 errors. If you refresh the page a bunch of time the problem goes away. But it comes back the next time you try to execute the procedure again. Here are the cases when the problem shows up.
    Editing the style:
    PROCEDURE : PORTAL30.wwpob_app_style.edit_style
    Saving changes to the banner for a page
    PROCEDURE : PORTAL30.wwptl_banner.savecustom
    Logging out
    PROCEDURE : PORTAL30.wwsec_app_priv.logout
    After setting the default user group and applying the changes:
    PROCEDURE : PORTAL30.wwsec_app_user_mgr.edit_user
    Creating a new group:
    PROCEDURE : PORTAL30.wwsec_app_group_mgr.create_group
    Opening the add portlet screen:
    PROCEDURE : PORTAL30.wwv_main.main
    There are a few other places but I don't have them documented. In ALL cases the problem goes away once we start and stop the Apache using the following comands:
    /app/oracle/n_portal/Apache/Apache/bin/apachectl stop
    ps -ef | grep httpd | grep n_portal
    /app/oracle/n_portal/Apache/Apache/bin/apachectl start
    After starting and stopping Apache the problem is gone for a little while (20-30 mins) then it starts coming back slowly (sometimes the problem is there then it is not). Once the problem is back if you continually press refresh on the browser (5-10 times) the page might appear, if the page does not appear you will see the
    ORA-00164: autonomous transaction disallowed within distributed transaction
    The following error appears in apache log (50% of the time) when Autonomous Transaction error shows up on the screen:-
    DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = 5225534324468880950975536484
    215 PortalSession id = 521335001720MERAJ
    DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = -638034231325135430097553725
    8001 PortalSession id = 992335001711JDALGLIESH
    These errors might be related to dynamic services but we were had the problem long before Dynamic services was installed.
    We want to start pre-production user testing as we have just had 11 developers building portlets for the company, but we cant do much with this error popping up every time a user wants to test it. We have one of the Oracle consultants here and he has asked the oracle developer group what the problem could be, and they seem to think it might be related to our use of DB links however, we never get the problem when we try to run a portlet that uses a database link.
    Please help.
    Jeff Dalgliesh
    null

    Jay,
    My name is Craig McCauley. I'm an Oracle Technical Manager working onsite at Unocal Indonesia. I'm with the Portal group in ATS.
    When I got here the first thing we did was bump up init.ora parameters and apache confif parameters as suggested by the iPlatform group. We have thes sessions parameter (in init.ora) bumped up from 100 to 700. I'm watching v$session and the get these AT messages with as few as 70 total db sessions. Any help your group can give will be greatly appreciated.
    Unocal is planning on implementing Oracle Portal globally - as a common interface. They have similar installs in Thailand and Houston and thus far have not seen the AT messages (although there has not been much development going on at those sites).
    Thanks,
    Craig

  • Works in sql not in apex: ORA-02049 distributed transaction waiting lock

    Hi,
    I get this error
    failed to parse SQL query:
    ORA-02049: timeout: distributed transaction waiting for lockwhen trying to run this query from it's page. But it works fine if I run it in the SQL console...
    failed to parse SQL query:
    ORA-select distinct n.notif_no,
           n.maint_work_centre,
           n.maint_work_centre_text,
           n.raised_by,
           n.notif_text,
           (select  (SAP_LONG_TEXT.NOTIFICATION_TEXT_1||SAP_LONG_TEXT.NOTIFICATION_TEXT_2||SAP_LONG_TEXT.NOTIFICATION_TEXT_3||SAP_LONG_TEXT.NOTIFICATION_TEXT_4||SAP_LONG_TEXT.NOTIFICATION_TEXT_5||SAP_LONG_TEXT.NOTIFICATION_TEXT_6||SAP_LONG_TEXT.NOTIFICATION_TEXT_7||SAP_LONG_TEXT.NOTIFICATION_TEXT_8||SAP_LONG_TEXT.NOTIFICATION_TEXT_9||SAP_LONG_TEXT.NOTIFICATION_TEXT_10||SAP_LONG_TEXT.NOTIFICATION_TEXT_11||SAP_LONG_TEXT.NOTIFICATION_TEXT_12||SAP_LONG_TEXT.NOTIFICATION_TEXT_13||SAP_LONG_TEXT.NOTIFICATION_TEXT_14||SAP_LONG_TEXT.NOTIFICATION_TEXT_15||SAP_LONG_TEXT.NOTIFICATION_TEXT_16||SAP_LONG_TEXT.NOTIFICATION_TEXT_17||SAP_LONG_TEXT.NOTIFICATION_TEXT_18||SAP_LONG_TEXT.NOTIFICATION_TEXT_19||SAP_LONG_TEXT.NOTIFICATION_TEXT_20||SAP_LONG_TEXT.NOTIFICATION_TEXT_21||SAP_LONG_TEXT.NOTIFICATION_TEXT_22||SAP_LONG_TEXT.NOTIFICATION_TEXT_23||SAP_LONG_TEXT.NOTIFICATION_TEXT_24||SAP_LONG_TEXT.NOTIFICATION_TEXT_25||SAP_LONG_TEXT.NOTIFICATION_TEXT_26||SAP_LONG_TEXT.NOTIFICATION_TEXT_27||SAP_LONG_TEXT.NOTIFICATION_TEXT_28||SAP_LONG_TEXT.NOTIFICATION_TEXT_29||SAP_LONG_TEXT.NOTIFICATION_TEXT_30||SAP_LONG_TEXT.NOTIFICATION_TEXT_31||SAP_LONG_TEXT.NOTIFICATION_TEXT_32||SAP_LONG_TEXT.NOTIFICATION_TEXT_33||SAP_LONG_TEXT.NOTIFICATION_TEXT_34||SAP_LONG_TEXT.NOTIFICATION_TEXT_35||SAP_LONG_TEXT.NOTIFICATION_TEXT_36||SAP_LONG_TEXT.NOTIFICATION_TEXT_37||SAP_LONG_TEXT.NOTIFICATION_TEXT_38||SAP_LONG_TEXT.NOTIFICATION_TEXT_39||SAP_LONG_TEXT.NOTIFICATION_TEXT_40||SAP_LONG_TEXT.NOTIFICATION_TEXT_41||SAP_LONG_TEXT.NOTIFICATION_TEXT_42||SAP_LONG_TEXT.NOTIFICATION_TEXT_43||SAP_LONG_TEXT.NOTIFICATION_TEXT_44||SAP_LONG_TEXT.NOTIFICATION_TEXT_45||SAP_LONG_TEXT.NOTIFICATION_TEXT_46||SAP_LONG_TEXT.NOTIFICATION_TEXT_47||SAP_LONG_TEXT.NOTIFICATION_TEXT_48||SAP_LONG_TEXT.NOTIFICATION_TEXT_49||SAP_LONG_TEXT.NOTIFICATION_TEXT_50) from sap_long_text@genadm where sap_long_text.notification = n.notif_no) "long",
           n.notif_date,
           n.funct_loc,
           n.order_no,
           n.notif_status,
           n.room,
           n.notif_type
    from   notifications@amt n, SAP_LONG_TEXT@genadm
    where  instr(':'||:P9_NOTIFTYPE||':',':'||n.NOTIF_TYPE||':')>0 and
           instr (':'||:P9_SITE||':',':'||n.site||':') > 0 and
           n.notif_date BETWEEN :P9_DATEFROM and :P9_DATETO and
           n.notif_status not like '%NOCO%'I've had this error before but I don't remember why/what happened. The page has been working fine, the error just randomly cropped up today.
    And a secondary question, is there a better way to write the query (it's a copy/paste from an older query). That select within the select is ugly...

    Hello,
    Take a look at the following thread -
    help ORA-02049
    Is it really necessary that you always query across the DBLink? Is using local materialized views not an option for you?
    John.
    http://jes.blogs.shellprompt.net
    http://apex-evangelists.com

  • SQL 2005 Distributed Transactions from WCF

    Hello,
    I've been redirected here from the Transaction Programming forum becuase I have e peculiar issue with SQL 2005 running INSERT stored procs from multiple WCF services all withing a TransactionScope.
    The original post is http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2720665&SiteID=1&mode=1
    The story goes, I have SRVC A with starts a TransactionScope which in turn calls SRVC B & C in sequence based on processing rules.
    SRVC A is a Sequential Workflow which Starts and Completes the TransactionScope
    SRVC B Creates a new Customer into the database
    SRVC C Creates new Accounts for that Customer and Initialises the accounts with funds
    The DB Tables underneath are Customer, Account and AccountLog
    DDL
    Code Block
    CREATE TABLE [Member].[Customers](
    [CustomerId] [int]
    IDENTITY(1,1) NOT NULL,
    [Name] [varchar](32) NOT NULL,
    [CreatedUtc] [datetime] NOT NULL ,
    CONSTRAINT [PK_Customer] PRIMARY KEY CLUSTERED
    [CustomerId]
    ASC
    CREATE TABLE [Bank].[Accounts](
    [AccountId] [int]
    IDENTITY(1,1) NOT NULL,
    [CustomerId] [int] NOT NULL,
    [CurrentBalance] [money] NOT NULL,
    [LastUpdateDate] [datetime] NULL,
    [CreatedDate] [datetime] NOT NULL,
    [timestamp] [timestamp] NOT NULL,
    CONSTRAINT [PK_Bank_Account] PRIMARY KEY CLUSTERED
    [AccountId]
    ASC
    ) ON [PRIMARY]
    GO
    ALTER TABLE [Bank].[Accounts] WITH CHECK ADD CONSTRAINT [FK_Account_Customer] FOREIGN KEY([CustomerId])
    REFERENCES [Member].[Customers] ([CustomerId])
    CREATE TABLE [Bank].[AccountLog](
    [AccountLogId] [int]
    IDENTITY(1,1) NOT NULL,
    [AccountId] [int] NOT NULL,
    [Amount] [money] NOT NULL,
    [UtcDate] [datetime] NOT NULL,
    CONSTRAINT [PK_Bank_AccountLog] PRIMARY KEY CLUSTERED
    [AccountLogId]
    ASC
    ) ON [PRIMARY]
    GO
    ALTER TABLE [Bank].[AccountLog] WITH CHECK ADD CONSTRAINT [FK_AccountLog_Account] FOREIGN KEY([AccountId])
    REFERENCES [Bank].[Accounts] ([AccountId])
    NB. I've removed most fields not essential for this example.
    So from SRVC A I invoke SRVC B and the Customer is created, however when I get to SRVC C and the accounts are to be created I get a lock.  Only when the Transaction aborts due to timeout, do I see in SQL Profiler that the call to the SP that created the Account is executed but eventually rolls back as it is part of the distributed transaction.
    Now, If I set the Isolation level in the TransactionScope to ReadUncommitted (urgh) the problem remains.  When I set the IsolationLevel to Read Uncommitted in the SP that creates the account the problem remains but when I remove the FK constraint the problem disappers.  The other curious thing is that with the Customer -> Account FK removed and when SRVC C calls to insert funds into the AccountLog which also updates an aggregated total in the Account from within the same transaction scope and with Account -> AccountLog FK constraints in place there is no locking even with Isolation Serializable.
    I'm quite at a loss as to what could be causing these issues.  If anyone has any suggestions I would greatly appreciate any help.
    Thanks
    Andy
     

    Andy,
    Is this still an issue?
    Thanks!
    Ed Price, Power BI & SQL Server Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Connection Factory class for Distributed Transaction?

    Definition of Managed Datasources goes like this at URL: http://download.oracle.com/docs/cd/B31017_01/web.1013/b28958/datasrc.htm#CHDDADCE
    Managed data sources are managed by OC4J. This means that OC4J provides critical system infrastructure such as global transaction management, connection pooling, and error handling.
    In the same document, I could also see a section for configuring Connection Pool, that uses 'factory-class' as 'oracle.jdbc.pool.OracleDataSource' as shown below:
    <connection-pool name="myConnectionPool">
    <connection-factory
    factory-class="oracle.jdbc.pool.OracleDataSource"
    user="scott"
    password="tiger"
    This configuration has worked well for my web application where I was using a single instance of Oracle database. In a new application I've to use two separate instance of Oracle databases and there is a need of distributed transaction.
    I know, I've to create two separate datasources for the two separate Oracle instances.
    My question is: Since now my transaction will be distributed in nature, do I need to use any other factory-class for configuring XA aware Datasources on OC4J? Or whether the same factory-class (oracle.jdbc.pool.OracleDataSource) will work even for distributed transactions?

    Here is the link for using Oracle RAC with WLS
    http://e-docs.bea.com/wls/docs81/jdbc/oracle_rac.html

  • Regarding Distributed Transactions

    I am aware of JDBC transactions. Now while reading EJB i came to know that EJB supports Distributed Transactions.
    My interpretation of Distributed transaction is
    e.g.
    Consider two CMT Beans A & B.
    Bean-A contains a method foo() with a transaction attribute "Required".
    Bean-B contains a method boo() with a transaction attribute "Required".
    Now when a method "foo()" in a transaction calls method "boo()", the method "boo()" runs in the same transaction as "foo()". so here the transaction travels from "foo()" method to "boo()" method.
    My Question: can i say the above is an example of Distributed transaction
    Please let me know my interpretation is correct or wrong.
    If wrong, please explain me in few words.

    Hi Naresh,
    Your interpretation is correct. Distributed transactions allow a transaction to propagate between
    component invocations. Typically, this propagation occurs between components that are collocated
    within the same JVM, but the propagation can also happen across JVMs, e.g. in the case of a
    Remote EJB invocation.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

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

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

  • Regarding distributed transaction

    may be xi does not support distributed transaction. as 2 phase commit
    really?
    if yeah,and i have the question the following:
    because as far as know,  xi will create seperate transaction for each step.
    and send step will influence the transactional behavior.
    by checking help, i knew
    we can set properties for send step not to start a new transaction.
    can anybody tell me where to set that?
    and then how can we assure transaction integrity.
    if not 2 phase commit protocol, and with what to do it?

    Hi ,
    Please check this blog.
    /people/sap.user72/blog/2005/10/15/jdbc-adapter-execution-mode-chained-or-unchained (JDBC Adapter execution mode Chained or Unchained )
    Ranjeet Singh.

  • 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

Maybe you are looking for

  • Image Link Problem with Dreamweaver CS4?

    On my website, I have several images that link to other parts on my website. These work no problem when I preview the site, but after I test the links, the images that had those links have purple outlines that really clash with my website's design. W

  • Known Issue in Nokia Lumia 720 - Virtual keys stop...

    Hi Nokia lumia 720 bottom virtual keys stops working after some time.............. only solution is to replace screen which costs 7000....     Is there any permanent solution? pls help

  • My Report S_ALR_87012272???

    Hello experts, I have created a new report and new form and linked them together (using FSI1 FSI4 etc..). Again I can execute my report correctly using FSI0. my problem is that when I run S_ALR_87012272 it is directly mapped to report 0SAPRATIO-03. h

  • How to jump to next marker of selected clip in timeline?

    So, I finally figured out how to mark my clips in CS6, but for the life of me I can't figure out how to navigate between clip markers in the timeline.  There's an obscure reference in the help files but as far as I can tell it's talking about sequenc

  • Legal half duplex printing with tops of pages along the fold not the edge of the paper

    So i am about to explode. i have a booklet 4.25 x 7 to be created on a folded legal sheet obviously along the short edge with the tops of the page to be along the fold. but i cannot get indesign to print it via the booklet print. i am trying, but it