How to implement Distributed Transactions in ADF?

Scenario:
when selected rows and submitted action from UI, following happens
1) For the selected rows, information will get fetched from database and a message will get formed and will get posted in JMS queue
2) once step1 is successful, corresponding record will get logically deleted
Implementation details:
Environment: Oracle ADF , Weblogic server
Step1: Created UI with Multi selection
Step2: getting selected row key information and calling a custom AM method (exposed as client interface) from managed bean passing selected row key info
step3: implementing following logic in AM method
while(keyList.hasNext()
1) getting View object for the given key and populating message
2) Posting the mesage in JMS queue configured in weblogic using JMS Helper classes written
3) updating the delete flag in VO
Problem statement:
In Step3 after sub step 2 executed, suppose if database is down substep3 will not get executed
because of which a record will get displayed again back in UI and when selected again a duplicated message will be sent to the concerned external system
I'm very new to ADF. Can anyone please help me on how to achieve this using ADF?
Much Appreciated,
Indu

Thanks Vinod for your reply
at substep 2 getting record from database and populating message and posting it to jms queue
at substep 3 if post is successful the updating database indiacting this message has been sent by updating delete flag
if i update database first and then if send message, In case of JMS exception(Can be Queue failures) my record will get updated and i cannot see record back in UI
So both these opertions has to be happened in in single Transaction.Either both has to be happened or both has to be rolled back
database and JMS are different resources. How ADF handles these XA transactions?
Thanks,
indu

Similar Messages

  • How to implement Distributed Transaction

    Hi,
    We are using Jsp/Struts/Bc4j application model. JHeadstart 9.0.5.1.
    We have the Distributed transaction issue. There are 2 BC4J Application Modules (AM1 and AM2), each with its own DB connection, Entity and View Objects. In a special case, when record is inserted via AM1, there have to be record created in the DB, via AM2.
    What is the recommended approach to do that? We can't define AM2 as submodule of AM1, because, when instantiated (in the corresponding doDML method on the entity in AM1), it will try to use the connection of AM1, which is wrong. When (which event), and how to instantiate AM2 (ensure write connection), get corresponding View Object, create the other record, and commit everything in one transaction? Btw, we can not use DB link.
    Regards,
    Vladimir

    Hi Vladimir,
    It seems to me that this is a generic BC4J issue, independent of JHeadstart. You could post it at the JDeveloper forum at http://otn.oracle.com/discussionforums/jdev.html.
    My suggestion (though I'm not sure it would work) would be to explicitly instantiate AM2 at the time you need it within AM1, with code like this:
      String        amDef = "test.AM2";
      String        config = "AM2Local";
      ApplicationModule am =
      Configuration.createRootApplicationModule(amDef,config);
      ViewObject vo = am.findViewObject("TestView");
      // Work with your appmodule and view object here
      Configuration.releaseRootApplicationModule(am,true);By the way, in JDeveloper 10g you can get this piece of code by typing bc4jclient followed directly by Ctrl+Enter.
    Hope this helps,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Settings for implementing Distributed Transaction

    Hi ,
    Can some one guide me as to what are the settings that need to be done on the Oracle client & server machine for implementing Distributed Transaction .
    I have ODP.Net client 11 & Oracle Database Server 10g.
    I read that I require Oracle Services for MTS to be installed on my system .
    When I check the services installed on my machine ,I found OracleMTSRecoveryService (so i assume Oracle Services for MTS is installed on my system) .
    I just can't figure out what part of settings I'm missing out ...
    Please guide .
    Many Thanks
    Girija

    Hello TeamIn,
    Please check if you are in the 32/64 bit situation in think KB:
    https://support.microsoft.com/en-us/kb/910907?wa=wsignin1.0 which is mentioned also in the link provided by David and you could confirm if there is 32/64 bit different version service on the
    azure forum.
    >>I am using Sql Server Express 2012 installed in an azure VM and App in Azure App services
    I am not sure how the Windows Azure SQL Database is defined, you could confirm it on the azure forum if your database is already a Windows Azure SQL Database and if so, according to this
    blog, it shows that the Windows Azure SQL Database does not support distributed transactions, which are transactions that multiple transaction managers (multiple resources).
    Regards
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to Increase distributed Transaction parameter value in oracle 10g r2

    Hello,
    Can you please let me know how to increase the value of Distributed Transaction Parameter in oralce 10g R2
    Thanks
    Usman

    Why do you want to increase this?
    If you are getting ORA-02042, you have to reduce the number of concurrent distributed transactions you are running or restart your database to clear existing ones.

  • 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

  • How to design Distributed transaction?

    Hi
    I have distributed transaction that involve MQ and two oracle database. In both database I have stroed procedure that have their own rollback points. My requirement is that either both database shoulb committed or none.
    For this to implement I have a MDB that calls SP on first database and without commiting any thing it comes back to MDB and again Calls SP on second database and again come back to MDB and call1 SP on database1..
    But problem is when I am calling 2nd database SP and if any thing goes wrong inside SP then its implicit rollback is not working. To overcome this I put this 2nd database logic in another EJB with RequiresNew. But then problem is that if MDB transaction is rolled back then 2nd database transaction is not getting roollbacked.
    Please suggest any solution to overcome this.
    Server is Websphere 6.0
    Database is: Oracle 10g
    Datasource: XA
    Q: MQ 6.0
    Thanks

    I think you can use Java Trasaction API that is independent of the Resources and will give you more flexibility to handle trasactions
    This link may be helpful
    http://www.onjava.com/pub/a/onjava/2001/05/23/j2ee.html

  • How to disable distributed transaction in Weblogic 8.1?

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

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

  • How to Implement Process Train In ADF

    I am using Jdeveloper 10.1.3.1.0
    Our requirement is to use process train in our project, so could anyone please knows this things that how to implement it please tell me.
    In Single page i am having so many tabs and each tab having one detail page and atlast it is going to submit all the details.
    Thanks In Advance
    Ramkumar
    Message was edited by:
    user636100

    Hi!
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3?topic=af_maintrain_html should give you all the information you require.
    BB

  • How to manage the transaction in ADF

    Hi,
    I am using jdev 11.1.2.3
    I have two BTF employee and department. I have main.jspx  in that two tabs employee and department. Now I have changed some value in employee and department. My current page is employee . When i click on commit button both the forms are getting committed. Can u plz tell me how do i manage the transactions ??
    My req is only my current opened tab should get committed even if i changed in both the tab .. How can i achieve this ??
    Thanks

    I have unchecked data control in department BTF. Now i can able to commit only employee form, Unable to commit department form ....
    My req is i have two form employee and department m using BTF in two diff tabs. I want the transaction must be independent for both BTF in same application module..
    Is this work when you put commit button on page inside BTF ?
    If you want to commit particular BTF with commit button placed outside of BTF, you will need to somehow invoke commit operation in BTF.
    For example, you can use contextual events( ADF: (re-)Introducing Contextual Events in several simple steps</title> //<title>AMIS Technology Blog &am…)
    Dario

  • How to implement next_record; (FORMS) in ADF

    Hi,
    I would like to implements automatically create new record when i press enter on a <af:inputText like next_record in forms, and copying some data from the current rowto the next row
    thanks
    Fakhri

    I found a solution for navigation between input text in <af:table that works fine in FireFox but not in Chrome :
    I create the javascript in the main page :
    <af:document title="index.jsf" id="d1">
    <f:facet name="metaContainer">
    <af:resource type="javascript">
    function setFocusMatric(evt) {
    var _keyCode = evt.getKeyCode();
    var compid = AdfPage.PAGE.findComponentByAbsoluteId("r1:r1:pc2:t2:matric");
    if (_keyCode == AdfKeyStroke.ENTER_KEY) {
    compid.focus();
    function setFocusValeur(evt) {
    var _keyCode = evt.getKeyCode();
    var compid = AdfPage.PAGE.findComponentByAbsoluteId("r1:r1:pc2:t2:val");
    if (_keyCode == AdfKeyStroke.ENTER_KEY) {
    compid.focus();
    function setFocusImpor(evt) {
    var _keyCode = evt.getKeyCode();
    var compid = AdfPage.PAGE.findComponentByAbsoluteId("r1:r1:pc2:t2:impor");
    if (_keyCode == AdfKeyStroke.ENTER_KEY) {
    compid.focus();
    </af:resource>
    </f:facet>
    <af:messages id="m1"/>
    <af:form id="f1">
    <af:decorativeBox id="db1" topHeight="60px">
    <f:facet name="center">
    <af:region value="#{bindings.dynamicRegion1.regionModel}" id="r1"
    partialTriggers="::reshum ::ctb4"/>
    </f:facet>
    <f:facet name="top">
    <af:panelHeader text="Module Administratif" id="ph1">
    <f:facet name="context"/>
    <f:facet name="menuBar"/>
    <f:facet name="toolbar"/>
    <f:facet name="legend"/>
    <f:facet name="info"/>
    <af:panelGroupLayout id="pgl1" layout="horizontal" halign="center">
    <af:commandButton text="Rollback" disabled="#{!bindings.Rollback.enabled}" immediate="true"
    id="cb1" action="#{viewScope.index.doCancel}" rendered="false">
    <af:resetActionListener/>
    </af:commandButton>
    <af:spacer width="30" height="10" id="s7"/>
    <af:commandToolbarButton id="reshum"
    inlineStyle="font-weight:bolder; text-align:center; vertical-align:middle; background-color:transparent;"
    partialSubmit="true" text="Resource Humaines" partialTriggers=""
    action="#{viewScope.index.rhtaskflowdefinition}"/>
    <af:spacer width="50" height="10" id="s6"/>
    <af:commandToolbarButton id="ctb4" partialSubmit="true"
    inlineStyle="font-weight:bolder; width:100px; text-align:center; vertical-align:middle; background-color:transparent;"
    text="Salaires"
    action="#{viewScope.index.salairetaskflowdefinition}"/>
    <af:spacer width="30" height="10" id="s1"/>
    after in my jsff :
    <af:inputListOfValues id="impor"
    popupTitle="Search and Select: #{bindings.DrdetimView3.hints.Cdimpor.label}"
    value="#{row.bindings.Cdimpor.inputValue}"
    model="#{row.bindings.Cdimpor.listOfValuesModel}"
    required="#{bindings.DrdetimView3.hints.Cdimpor.mandatory}"
    columns="#{bindings.DrdetimView3.hints.Cdimpor.displayWidth}"
    shortDesc="#{bindings.DrdetimView3.hints.Cdimpor.tooltip}"
    partialTriggers=":::ctb1 :::ctb2">
    <f:validator binding="#{row.bindings.Cdimpor.validator}"/>
    <af:clientListener method="*setFocusMatric*" type="keyPress"/>
    in FireFox the navigation was succeeded but Chrome cannot fire the AdfKeyStroke.ENTER_KEY
    is there another solution for all web browser
    thanks

  • How to implement distributed work queue

    Hi,
    I have a simple problem: I need to implement a work queue, in which the "workers" are different processes running in different JVMs.
    So I need to have a centralized (singleton), failure-free queue which contains works, and workers will connect to this queue and retrieve work to be processed.
    To be more clear, what I need coherence to hold is the queue, and be sure that each work is dispatched to only 1 queue-listener.
    Is this possible with coherence ?
    Which is the best pattern to implement this?

    Humm...
    Using ur solution would mean get and put the whole queue on the cache for each use, right ?
    Anyway this answered my question:
    http://www.infoq.com/presentations/Data-Grid-Design-Patterns-Brian-Oliver
    Edited by: GheParDo on Mar 29, 2011 11:37 PM

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

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

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

  • 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

  • Distributed transaction Management

    How Oracle8i manage distributed transaction?

    Unfortunately to manage transactions over web services there is no viable solution available in market. All implementations come with restrictions e.g. Metro works with only EJBs on Glassfish, JBossTS works on JBoss but not with JAX-WS, Atomikos supports only Axis as of now.
    1. See explanation above.
    2. Yes, it can be but conditions mentioned above are applied :-)
    3. [www.oasis-open.org/committees/ws-tx/|www.oasis-open.org/committees/ws-tx/]
    4. Unfortunately as of now I do not see an easy way to this problem.

  • How to give JASS Security to ADF BC Swing Application.

    Hello Friends,
    ->I read lots of threads about JASS Security in ADF about Web Application.
    ->But i am not getting any solution/Document Which explains, How to Implement JASS Security to ADF BC Swing Apllication.
    -> I Will Explain Which type of application we developed.
    We had developed one Whole ERP Product by using ADF BC [Swing] Technology.We have 480 Forms in our Application.Now i need to give security to my Application.
    ->I Will Explain Structure of Application.
    We have seperate Application Module for each form means i have 480 Application Modules in my application.I create seperate session beans for each Application Module and I deploy it on Standalone OC4J Server
    So please friends help me out to give security to my application.
    Thanks in Advance.

    Hello Franks
    First thanks for your reply.
    --> As you suggested two options for me but i would like to go with second option.
    JAZN with ADF BC.
    ---> As you said i need to do jbo.security.enforce property set to "auth".but currently i made it "Test" to trace login user means to set History Columns.
    --->Frank i am waiting for your documents.If you have documents in the format of how-to-do then Please Forward me.
    Thanks Frank

Maybe you are looking for

  • Alert long text not visible

    Hello, I have a problem triggering an alert with dynamic text out of a bpm. The alert is triggered correctly (I can't see any dump in tzhe log files), I can see the alert in my alert inbox, but the long text isn't filled. I'm using SAP Netweaver 2004

  • Length of new mac mini adapter

    Just ordered a Dell 21.5 monitor yesterday as I plan on ordering a new mac mini today. The monitor has DVI and HDMI connections. I will probably use the mac mini HDMI to connect to my Samsung LCD TV for watching movies and use the DVI connection to t

  • HT202856 Dell P2715Q for 2013 Mac Pro.

    The new Dell P2715Q 4K monitor looks to be a technically compatible monitor for the new Mac Pro.  I see it supports DP 1.2 and MST. Anyone using this monitor and and vouch for its use. Thanks.

  • Add Custom Field to VA01

    Hi Experts, I have to add one field to screen in transaction VA01. I have the below details: Program Name: SAPMV45A Screen Number where field is tobe added: 8459 ( Its properties says as Subscreen) I didnot find a enhancement name that include a scre

  • Getting Metadata of previous versions

    Hi , I have a requirement to store various versions of an XML using oracle Xml db. I also have some custom metadata which is associated to each version of the file. We are having problems when updating the metadata. We tried using DBMS_XDB.UPDATERESO