Advise on using DBMS_XA with multiple branches under one global transaction

Dear all
I need some advise on using DBMS_XA from PL/SQL with tightly coupled multiple branches under one global transaction. Basically, I've successfully written some PL/SQL code that in 3 different sessions attaches to 3 different branches of one global transaction and before ending each branch they can see each others uncommitted data. So far so good.
However, I'm not sure I completely understand how each branch must call xa_end, xa_prepare and xa_commit correctly using two phase commit and my calls result in errors like:
ORA-24767: transaction branch prepare returns read-only (XA error code 3 = Transaction was read-only and has been committed)
ORA-24756: transaction does not exist (XA error code -4 = XID is not valid)
ORA-02051: another session or branch in same transaction failed or finalized
This is the structure of my programs (3 SQL*Plus sessions):
main: Uses xid 123|0 (branch 0 of global transaction 123). This should be the coordinator that commits using two phase commit across the 3 branches
m1.xa_start tmnoflags
m2.DML
m3.Wait for thread A + B to manually be started and run xa_end
m4.xa_end tmsuccess
m5.xa_prepare
m6.xa_commit false
thread A: Uses xid 123|A (branch A of global transaction 123)
a1.xa_start tmnoflags
a2.DML -- thread A can see main and thread B's data
a3.xa_end tmsuccess
a4.xa_prepare -- required?
a5.Should we also call xa_commit false?
thread B: Uses xid 123|B (branch B of global transaction 123)
b1.xa_start tmnoflags
b2.DML -- thread B can see main and thread A's data
b3.xa_end tmsuccess
b4.xa_prepare -- required?
b5.Should we also call xa_commit false?
The failing steps are:
m5
m6
a4
a5
b4
b5
Before starting calling xa_end I see 3 rows in V$GLOBAL_TRANSACTION, eg (hex 7B = decimal 123):
FORMATID GLOBALID BRANCHID BRANCHES REFCOUNT PREPARECOUNT STATE FLAGS COUPLING
203348753 0000007B 00000000000000000000000000000000 3 3 0 ACTIVE 0 TIGHTLY COUPLED
203348753 0000007B 0000000000000000000000000000000A 3 3 0 ACTIVE 0 TIGHTLY COUPLED
203348753 0000007B 0000000000000000000000000000000B 3 3 0 ACTIVE 0 TIGHTLY COUPLED
Thanks a lot in advance.
Cheers
Finn

OK, I've figured it out. This is poorly documented as it's not well explained how to handle the various return codes. Turns out that all but the last xa_prepare calls return dbms_xa.xa_rdonly (tightly coupled branches are combined -- "read only" optimization), the last one returns dbms_xa.xa_ok and this is when you should call xa_commit.
Now my next problem is that DBMS_XA doesn't work from within jobs (DBMS_JOB and DBMS_SCHEDULER), which makes it very difficult to use DBMS_XA. My purpose of using DBMS_XA is to coordinate work across multiple sessions in one transaction but if I can't easily create the multiple sessions, I'm stuck.
When called from a job, xa_start throws:
ORA-24789: start not allowed in recursive call
on Oracle 11.2. In Oracle 11.1 it works, but xa_end fails with
ORA-25352: no current transaction
so I guess in fact the xa_start call didn't really work either, even though it returned tm_ok.
I'm now trying to find a workaround on how to use DBMS_XA from within jobs, please comment if you have any suggestions. Or if you have any suggestions on other means of establishing the concurrent sessions (I wouldn't like to resort to external programs that need username/password to connect as password management would be a security issue).
Thanks in advance.
Cheers
Finn

Similar Messages

  • Use case for multiple crosstabs under one datasource

    I'm trying to understand why one would have multiple crosstabs for one datasource.  When I change one crosstab, it changes the other crosstab.  I was could have a different layout for multiple crosstabs.
    Thanks.
    Regards,
    Mel Calucin

    Hi Mel,
    I am not following this question; would it be possible to rephrase it?
    You could have multiple tabs for a data source - such as a one tab showing the result set in a cross tab and the other for a chart.
    Tammy

  • What are the options to use itunes with multiple accounts on one computer

    I am totally confused; apple phone support seems to have no clue at least the person I spoke to. I want to get two iTunes accounts on one computer, one exists already. I am not sure what apple allows in this case. I was told at a apple store that if you create another PC profile you should be able to get the second iTunes account on the same computer with the new windows profile. There seems to be no info on the discussions board to this issue.
    I do not want to share an account and have a second library I think it would be too confusing for the other person. Is this possible?

    You can purchase music using multiple accounts within the same Windows profile & using the same iTunes library. I think when you log into the store it remembers the last account name used, but provided you don't let it remember your password then you have the opportunity to enter the correct details for each purchase.
    If you're going to place these purchases on your respective iPod's the following may help.
    *How to use multiple iPods with one computer*
    The Apple support document How to use multiple iPods with one computer suggests a number of ways. I use method two (Sync with selected playlists) with a slight twist. Rather than regular playlists I set the grouping field to indicate which users should receive which tracks and create smart playlists based on the content of this field.
    e.g.
    "Alice's Tracks" is "Grouping contains Alice" + "Kind contains audio"
    "Bob's Videos" is "Grouping contains Bob" + "Kind does not contain audio"
    Tracks that both Alice & Bob want on their iPods have the grouping set to "Alice/Bob"
    etc.
    I currently manage our family's five iPods using this system, each getting a different selection to suit their tastes and the capacity of their iPod. An advantage of using the grouping field is that it is stored in file tags (for non-wav audio files anyway) so that it is relatively easy to recreate the playlists should the iTunes library get trashed. Also useful if you move files about manually as playlist membership is preserved when you delete & re-import the tracks.
    tt2

  • Using Facetime with multiple accounts on one imac

    At first I tried to connect on facetime from my imac account to my MBP computer but was unsuccessful because I suspect I was using the same email for both.
    Then I activated facetime on the imac for my wife who has an account on the imac and then tried from the MBP to connect to her account on the imac and am unable to do so. I can use her account on the imac to connect to my mbp.
    Has anyone else been able to make such a connection. It would seem to me that it does not matter which account on the imac one is using.
    Thanks,
    Shannon

    Shannon Coffey1 wrote:
    At first I tried to connect on facetime from my imac account to my MBP computer but was unsuccessful because I suspect I was using the same email for both.
    Then I activated facetime on the imac for my wife who has an account on the imac and then tried from the MBP to connect to her account on the imac and am unable to do so. I can use her account on the imac to connect to my mbp.
    Has anyone else been able to make such a connection. It would seem to me that it does not matter which account on the imac one is using.
    Thanks,
    Shannon
    I have made successful FaceTime connections both to and from every possible combination of my iPod touch, Mac Pro, and MacBook Pro.
    In order to connect FaceTime between different devices, each device must have a unique identity.
    For Macs and iPods touch, these identities must be unique Apple iDs. If you have done this and can connect in one direction but not the other, check the typing carefully. One of the devices may have an error in the correct contact info.
    Mac Pro Quad Core (Early 2009) 2.93Ghz Mac OS X (10.6.4); MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.4)
    LED Cinema Display; G4 PowerBook 1.67GHz (10.4.11); iBookSE 366MHz (10.3.9); External iSight; iPod touch 4.1

  • HT204053 Can I set up icloud services on multiple iphones under a single account? More specifically, can I use- find my iphone services -under one account?

    Can I use Find My iphone service with multiple iphones under one account? I have 4 iphones in my family and I want to monitor all phones by logging into one account!

    You can create and use different iCloud accounts on the same computer, whether they are single or multiple user.
    There is a limit of 3 accounts you can create from a device but I thought this was only iOS devices - maybe not.
    iCloud accounts can only be created using a valid email address, so I guess I'd start there to retrace what accounts you have.
    My Apple ID and iForgot.com may be useful sites for you.

  • Multiple Schemas under one user account with XE 10g

    Hi,
    I am using (learning) XE 10g. I would like to know if it is possible to have multiple schemas under one user account and have the schemas logically separated. As of right now, I have three schemas that I am working with, each one under a different user account. This is inconvenient, because I have to logout of one user account and login to another user account simply to be able to work with another schema.
    Thanks

    It isn't possible to have multiple schemas under one database user account. It is of course possible to grant rights to other database users, and or roles, in order to allow access to the tables/data from other accounts. In Oracle there is a one-one mapping between schema and user.
    Niall Litchfield
    http://www.orawin.info/

  • How to use OSD with Multiple DPs to remote locations

    Hi
    My SCCM 2012 R2 Primary site is located on my corporate office but i need to use OSD for multiple branch locations in different subnets.in My Organization there is network level DHCP server rather than Windows DHCP...
    What would be the complete configuration in this case .. can some one provide the steps..
    Shailendra Dev

    Hi,
    The best way to forward the PXE boot requests to the DP/PXE server is to use IP Helpers in the routers/switches. I assume that the branch locations are without a DP. You can use DHCP scope options in the DHCP servers as well but you will end up with problems
    when PXE-booting machines that run UEFI becuase it is not the same bootfile used and it is not really supported.
    Maybe standalone media could be an option where you have the most of the TS on a USB stick/Drive.
    Regards,>
    Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Audiences with multiple "Reports Under" rules

    I am creating an audience with multiple "Reports Under" rules with the "Members satisfy any of the rules" option.
    Steps
    Create the audience.
    Choose Members satisfy any of the rules
    Choose Reports Under and specify a value (manager one name).
    Choose OK, then Add rule.
    Choose Reports Under and specify a value (manager two name).
    Compile.
    Results
    Only members of manager two's team are in the audience.
    Remove manager two and compile. Now only members of manager one's team are in the audience. Now add some other attribute, such as Department contains, then include manager two's department name. Compile and you see that the audience now contains all team
    members from manager one (reports under rule) and manager two's (dept contains rule) teams.
    Can an audience contain multiple "Reports Under" in SP2013? I seem to remember doing this successfully in SP2010.

    Hi Gilbert,
    According to your description, my understanding is that the audience which was set to satisfy any of the rules cannot work correctly with Reports Under rules in SharePoint 2013.
    I tested the same scenario per your post in my environment, and I got the same results as you got.
    We will help to submit the issue to proper pipeline for you.
    Again, thank you for your report which will definitely make SharePoint a better products. There might be some time delay. 
    Appreciate your time and patience.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • APD using Query with multiple structures as a data source

    All,
    I want to set up an automatic process which executes a query and exports it to a shared drive as a csv file. I have tried various options , when I try to use APD to set up the extract, I get an error and this is because the query that I am trying to use has Strucutres in both rows and columns. Hence, I am unable to use this option. I tried RSCRM_BAPI, It works well, but there is an issue with scheduling this in Process chain. I created an event and scheduled this as a job to trigger after "event" as per SAP instructions, but the job does not exist and it is not possible to trigger it through the Process chain unless the variables are hard coded in the query which I do not want to do.
    Can any one tell me if there is a way to deal with APD using Query with multiple structures?
    Would really appreciate if some one can give me the right solution...
    Thanks

    Hi Tanu ,
    APD is an option but its not very good with large amount of data or hiearachies or if you have attributes in you query structure .
    One more option for this requirement is use of report program using function module RRW3_GET_QUERY_VIEW_DATA .
    This will work fine with multiple structure etc .
    There are some overheads with this FM  ex: if amount of data is too much then program will give dump .Solution for that is we call the FM in LOOP by diving amount of data need to be fetched .ex:  we can read data quarter wise.
    For using this function module what you can do is write an ABAP program (At SE38 ) .which will call this FM and then write the output into a flat file which you can save at application server (AL11) .From there other system can read it .
    To automate this whole process you can further add all the report programs into a process chain (RSPC) which can be schedule as per requirement .
    To pass input parameters you can use variants that will pass the values to the report .
    Check thi link for sample code :
    [http://www.tricktresor.de/content/index.php?navID=696&aID=496]
    Hope this will be helpful .
    Regards,
    Jaya Tiwari

  • Can there by multiple accounts under one id?  I just loaded a $25 gift card and it showed up in my balance.  My daughter, under the same id had $12.0 left from a previous gift card.  Now only the $12.01 shows up and the $25 is nowhere to be found?

    Can there be multiple accounts under one apple id?  My daughter and wife apparently share an id between my daughter's ipod and my wife's ipad.  My daughter has what she believes is her $12.01 left from a gift card.  My wife loaded a $25 gift card recently (I saw the $25 balance in her account when she was done) and after a password change, now all that shows up is the $12.01?

    Greetings,
    I've never seen this issue, and I handle many iPads, of all versions. WiFi issues are generally local to the WiFi router - they are not all of the same quality, range, immunity to interference, etc. You have distance, building construction, and the biggie - interference.
    At home, I use Apple routers, and have no issues with any of my WiFi enabled devices, computers, mobile devices, etc - even the lowly PeeCees. I have locations where I have Juniper Networks, as well as Aruba, and a few Netgears - all of them work as they should.
    The cheaper routers, Linksys, D-Link, Seimens home units, and many other no name devices have caused issues of various kinds, and even connectivity.
    I have no idea what Starbucks uses, but I always have a good connection, and I go there nearly every morning and get some work done, as well as play.
    You could try changing channels, 2.4 to 5 Gigs, changing locations of the router. I have had to do all of these at one time or another over the many years that I have been a Network Engineer.
    Good Luck - Cheers,
    M.

  • Multiple subnets under one vlan

    Hi everyone,
    Is there any way to create multiple subnets under one VLAN ? Right now, I am using VLAN 110 and it's IP is 172.16.0.1/16.
    We have three types of devices on this VLAN.I want to create 3 or 4 subnets for those devices under this VLAN for reducing the traffic or broadcast ?
    Please advise me.....
    Thanks in advance

    Mohammed,
    As long as you have a single VLAN only, you will not reduce the amount of broadcasts in this VLAN by using several IP networks. Even if the stations are in different IP networks within a single VLAN, every broadcast will be sent across the entire VLAN to all stations, regardless of their configured IP address. Broadcasting is a matter of Data Link Layer, or Layer2, and if you keep a single Layer2 domain (the VLAN), you will keep a single, merged, large broadcast domain.
    Just to answer your question, you could assign multiple addresses to an interface in a single network/VLAN by using secondary IP addresses, for example:
    interface Vlan110
    ip address 172.16.0.1 255.255.0.0
    ip address 192.168.1.1 255.255.255.0 secondary
    ip address 10.20.30.1 255.255.255.0 secondary
    However, as I explained, this will only allow you to "stretch" multiple IP networks over a single broadcast domain so there is no saving in terms of broadcasts or traffic reduction. For that, you must resort to multiple VLANs.
    Best regards,
    Peter

  • Problems with multiple idocs in one file ( Inbound file )

    HI,
    Thanks in Advance for your suggestions.. Highly appreciated.
    We have problems with multiple IDocs in one file.
    We are using XIB ( Amtrix ) as Middleware to receive the files.
    Curretenly When the file contains one IDoc then there is no problem. IDoc is created and everything is ok.
    If file contains two IDocs ( for example two messages ORDERS and DELVERY ) then it is creating two IDocs but both IDocs contains ORDERS plus DELIVERY segements information. That is the problem. Some how SAP unable to differentiate the IDocs in the file.. But it knows that how many idocs are there in the file..because it is creating exact number of idocs.
    We are using TRFC port ... Do I need to change it to File port..
    When we have more than one idoc do we need set any parameter in the file ...

    Thanks for the swift response. Always ideas are useful.
    As of now , Middleware cannot split the file.
    Thing is SAP is creating two Idocs with different message types. Problem is First IDoc contains ORDERS message type but also DELIVERY segments as well. Second IDoc with DELIVERY message tyoe but ORDERS segments as well... This is the problem... I think we are missing some field activation in file for EDIDC record.
    As far as I know file port supports the number of IDocs in one file.. Hope TRFC port also supports that

  • I have one iPhone 4s, one iPad 2 and wife's iPhone 4s. yesterday I have updated all with ISO 8 under one apple id, now my problem is that in same WiFi when Any of phone receive phone all the three gazettes ring simultaneously . how to resolve this.

    I have one iPhone 4s, one iPad 2 and wife's iPhone 4s. yesterday I have updated all with ISO 8 under one apple id, now my problem is that in same WiFi when Any of phone receive phone all the three gazettes ring simultaneously . how to resolve this.
    regards
    rbv

    Tell your wife to get her own Apple ID. If you do not want continuity/handoff to work with calls, on both devicesgo to Settings==>>FaceTime==>> Turn OFF iPhone cellular calls.

  • HP Officejet 6500A How do I scan a document with multiple pages into one file?

    HP Officejet 6500A Plus e-All-in-One Printer - E710n
    Windows 7 (64 bit)
    How do I scan a document with multiple pages into one file?  My old printer (psc 2110) asked after each scan if I wanted to scan another page.  At the end I had one pdf file with multiple pages.
    This new one creates one file for each page and I cannot find a way to create one pdf file with multiple pages.
    This question was solved.
    View Solution.

    Hi mpw101,
    If you load the papers into the ADF - Automatic Document Feeder, and then select Document to PDF then they will all be scanning into one file. Let me know if this works for you?
    I am an HP employee.
    Say Thanks by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as "Accepted Solution"

  • The sort field is not used when ordering multiple cds in one alumn folder, how do I correct this?

    It is using the track number and not the sort order field.  The reason I have multiple cds in one alumn is because they are books on cd.

    Sorry for the typo my "b" key was not working correctly.
    The sort field is not used when ordering multiple cds in one albumn folder, how do I correct this?  It is using the track number and not the sort order field.  The reason I have multiple cds in one albumn is because they are books on cd.

Maybe you are looking for

  • Save for Web keyboard key stroke not worky

    I'd swear I've asked or seen this discussed in these forums...but I can find no thread, even when I search for my own screen name. At any rate, I think it also happened to me back in version 6. I'm now in version 8 on a Mac. The symptoms are the same

  • Connecting TV to imac

    Can anyone tell me which cable and which adapter I need to connect to a Panasonic TX37P plasma TV? The TV has HDMI ports? Cheers for any advice. Chris

  • Blackberry service in China using local sim card.

    I have a Bold 9700 (unlocked) which I would like to use in China. I am hearing that it may be tough if not impossible to get a pre paid sim with voice and data capabilities. Is data just blackberry email and messaging or does it include GPS and Inter

  • Need help ASAP - General Error (No Number)

    Hey everyone, so I'm trying to edit a 1920 x 1080 Pro Res 422 (HQ) sequence and not matter what I do, I consistently get a general error during playback. It should be noted that the project and all it's attributed files sit on an 2TB external drive h

  • What recording option(s) will allow me to snip out portions of the presentation?

    What kind of initial recording option(s) in Captivate 5.5 will allow me to snip out portions--a few seconds here, a few seconds there--of the visual presentation? (It seems like I'm selecting recording options that don't permit this.) Also, how do I