Transaction Control in ADF

Hi All,
I have multiple APP Modules whcih points to different databases. I have one operation whcih writes data in two databases and commit should occur only if both transactions succeed. I think I should do this by using the commit and rollback operation available for the two app modules data control. So in the backing bean I have a custom method with try catch against transactions. In case of any exception both the transactions will rollback. If there is no exceptions both the commits
will trigger.
Is this OK or there is any other recommended way or place to achieve this rather than backing bean?
Regards,
Sam

Hi,
I do not think ADF supports two phase commit, so you can only do this manually.
Root application modules will not fix it if you have different database connections either.
So yes, backing bean is the only good option.
-Anton

Similar Messages

  • Business Transaction control based on equipment status

    I have created status profile  for equipment creation . One of the user status is "Created by User" . Now If the user status of the equipment is this , I  want  to disallow notification creation through iw21 on this equipment .
    Please explain in detail how to achieve this through transaction control in status profile (I have already tried object type "maintainence notif " etc in status profile ....but did not find transaction create notification which has to be forbidden .)..
    Also please explain how to view transaction code along with business transaction in transaction control screen ..(any alternate way ?)
    NPB

    hi
    kindly specify the object type as Equipment and check
    I am not sure, kindly mark the Create Log Notification as forbidden for the user status
    regards
    thyagarajan

  • Business Transaction Control is not Working for Equipment Status.

    Hi All,
    I have created a Status Profile for Equipment / Functional Location & assigned 5 Status under this Profile i.e. NEW, COM (Commissioning), INS(Inservice), CAM (Care & Maintenance) & DCM (De Commissioned). For Status DCM i have assigned Transaction control FORBIDDEN for "Enter PM processing data , Enter PM planing data & Create Meas. Doc."activities.
    It Means, whenever user creates Plant Maintenance Order OR Notification, Maintenance Plan OR Maintenance Item & Measurement Document for any Equipment / FL having this user status (DCM), system should not allow creation of above mentioned object.
    In my scenario, system is giving an standard error message " The business transaction cannot be carried out" during creation of "Plant Maintenance Order OR Notification, Maintenance Plan OR Maintenance Item".
    But i am able to create measurement document for equipment / FL having user status DCM with Transaction control Forbidden of Measurement document creation. No error message displayed by the system.
    Can anybody tell me why its happening? Why system is giving error during order & plan creation but not for Creation of measurement document ?
    If this is not posible in standard SAP, does any body knows about any OSS note so that we can implement the same to get an error message.
    Thanks in advance
    Arun

    Please ensure whether both projects have the same budget profile. Other than that you need to carefully investigate how the cost was posted onto both projects in the first place. Please note in case of procurements, budget is only checked at the commitments level (search the forum as this has been discussed before).
    In case this does not resolve your issue, revert back with the budget profile settings.
    Regards,
    Ammar

  • Configuring toplink with EJB to transactional control "CMT"

    I try to use the EJB transaction CMT but I need to configure toplink to use a transactional control of my EJB container. some body knows how can i do this? and how can I configure the toplink to get JNDI datasource?
    Best Regards

    I dont think there is anything in Toplink you need to configure for CMT. All the transactional attributes are specified in the ejb-jar.xml file and I dont think you can edit this file using the Workbench or the Sessions Editor. With CMP the Workbench gives you an option to either overwrite this file or update but there is no way to "update" for transactional attributes. You can look at the examples for CMP (under folder advanced) that shows you how to use entity beans with Toplink in a CMP environment and you can look at the ejb-jar.xml file for more information.
    Configuring Toplink to get JNDI data source is easy-thats defined in the sessions.xml. Just open the sessions.xml using the sessions editor and click on login tab and then enter in the data source information.
    I try to use the EJB transaction CMT but I need to
    configure toplink to use a transactional control of
    my EJB container. some body knows how can i do this?
    and how can I configure the toplink to get JNDI
    datasource?
    Best Regards

  • Transaction control statements in loop

    for i in p_time_duration_rspm_spm.first..p_time_duration_rspm_spm.last
    loop
    insert into green.solids_aaqm_namp(sample_nr,time_duration_rspm_spm,monometer_reading,
         avg_flow,total_sampling_period,vol_air_sampled,
                             filter_paper_nr,cup_nr)
                   values(p_sample_nr,p_time_duration_rspm_spm(i),
                        p_monometer_reading(i),p_avg_flow(i),
                        p_total_sampling_period(i),p_vol_air_sampled(i),
                        p_filter_paper_nr(i),p_cup_nr(i));
    end loop;
    hallo,
    i am facing a problem in the insert statement.There is a table(3*6).the fields in the table are
    of number datatype.if any character is entered in any of those field a error message as to be
    displayed.
    and if a character is entered into second row, then the readings in the first row is inserted
    in to the table and then a error message is prompted.i want to know whether can we use the transaction control statements
    within the loop to avoid inserting only one row.if so, how?...is there any other way to implement the same at the form level
    before going the database.

    Hello,
    FORALL i in p_time_duration_rspm_spm.first..p_time_duration_rspm_spm.last SAVE EXCEPTIONS
    insert into green.solids_aaqm_namp(sample_nr,time_duration_rspm_spm,monometer_reading,
    avg_flow,total_sampling_period,vol_air_sampled,
    filter_paper_nr,cup_nr)
    values(p_sample_nr,p_time_duration_rspm_spm(i),
    p_monometer_reading(i),p_avg_flow(i),
    p_total_sampling_period(i),p_vol_air_sampled(i),
    p_filter_paper_nr(i),p_cup_nr(i));
    end loop;
    If wants Errors then
    errors := SQL%BULK_EXCEPTIONS.COUNT;
    dbms_output.put_line('Number of DELETE statements that failed: ' || errors);
    FOR i IN 1..errors LOOP
    dbms_output.put_line('Error #' || i || ' occurred during '||
    'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
    dbms_output.put_line('Error message is ' ||
    SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
    END LOOP;
    OR You can use as follows
    for i in p_time_duration_rspm_spm.first..p_time_duration_rspm_spm.last
    loop
    begin -- Newline Added
    insert into green.solids_aaqm_namp(sample_nr,time_duration_rspm_spm,monometer_reading,
    avg_flow,total_sampling_period,vol_air_sampled,
    filter_paper_nr,cup_nr)
    values(p_sample_nr,p_time_duration_rspm_spm(i),
    p_monometer_reading(i),p_avg_flow(i),
    p_total_sampling_period(i),p_vol_air_sampled(i),
    p_filter_paper_nr(i),p_cup_nr(i));
    EXCEPTION when OTHERS then -- Newline Added
    null; -- Newline Added
    end; -- Newline Added
    end loop;
    Bye
    Chitta

  • Separate transactions in one ADF app?

    Hello All!
    Is it possible to create two (ore more) separate transactions in one ADF ApplicationModule? I use JDev 10.1.2 and the default stack: ADF BC, Struts and JSP.
    I would like to do something similar:
    I've got two tables, orders, and partners. Partners may have one or more orders.
    1. I create a new order object.
    2. I would like to set the order's partner attribute.
    3. I navigate to another page to select the partner to populate with it the new order's property.
    4. The partner doesn't exist in the table yet, so I create a new one.
    5. I want to commit the partner's changes into the DB, and go back to the orders page to continue the orders data entering with the new partner's id populated into new order's data.
    6. But if I finally rollback the order's changes I would the partners changes not to lose.
    As far as I understand, if I use more ApplicationModule instances, I can do this easily create order instance in one AppMod and the person instance in the another one, and so I can commit or rollback them separately.
    Is it possible with one AppModule instance? Or is there any other solution for it?
    Thanks a lot in advance!
    NS

    To my knowledge 1 AM instance = 1 Transaction.
    So you'll have to create the Partner in a separate AM and commit the transaction in order to use the new Partner in the other AM instance.
    Regards
    Fred

  • How to handle transaction control--- in the dbms query or in JDBC? or BOTH?

    Hi all,
    we have a servlet application which do insert, update to a few sybase tables. so far we don't have any transaction management control in either store procedure or in JDBC call. i like to know where should we enforce this control logic? in both place or either one is enough?
    thanks!!

    according to your answer, is it safe to say that we
    should NOT
    handle transaction control in both query and JDBC
    call? i am on the side of JDBC
    program control. However our manager feels that if we
    handle it in two place, we could be more error-proof.
    i don't know how to convince him that only one place
    could make it work. Double your rollbacks double your fun! Odd that a manager is getting involved at this level...
    Providing transaction control at both places, as a rule makes absolutely no sense at all (to me). I actually believe that this would be far more error-prone (not error-proof). It's really a logistics issue. When you are working on the Java code, you won't have the stored procedure(s) code right there. While you may design it masterfully at first, as maintenance occurs, the mastery can easily be lost as assumptions are made on when and where commit or rollback processing is going to take place. The end result would be a system that could easily corrupt the logical integrity of the database.
    If you have to make a decision up front, and you believe performance will ultimately be a concern, then your decision should be to handle transaction management within the stored procedure(s). However, this decision will make the stored procedures far more complex than what the DBA or application staff is familiar with. You would also have to take some care to release resources as appropriate within the Java code.
    If you decide to manage transactions within JDBC, it is possible that you will have to move a portion of transaction managment to one or two of the stored procedures. This would be a 'fix' for a poorly performing functionality, and you would simply take care to limit this as much as possible.
    I wish I could guide you specifically, but I'm working at 20,000 feet related to your specific application needs.

  • External transaction control and ability to find new registered objects

    Hello, We are using Toplink with external transaction control and have a process inserting a complex hierarchy of objects. During the process we either do a registerObject or deepmergeClone depending on if the instance is already in the db. With external transaction control the registerObject does not actually do the commit to db until the global transaction (Container) issues the commit. Unfortunately we end up doing creating multiple instances of same objects ( because the assumption that registerObject would have written the row to the db ) with the same keys and when the container issues the commit we end up with duplicate key violation. Is there a way to find out if an object with a particular key is already registered?

    This sounds like the kind of question that can only be answered with a whiteboard and a good review of your architecture.
    In general, there should be no problem registering objects multiple times. I.e.,
    x = some object
    x1 = uow.registerObject(x);
    Then x1==uow.registerObject(x), and x1==uow.registerObject(x1), etc. When you register an object with the UOW, based on PK it'll always return that same one.
    Do you have multiple units of work on the go? (that may explain this behavior).
    In any case, I think the real problem here is that you're somehow registering objects that are no longer cached. I.e., some object is serialized or rebuilt and then registered after it's gone from the cache. By default, TopLink determines if an object is new or existing (to determine INSERT vs UPDATE) by hitting the cache. You can change this default behavior in the Mapping Workbench, open the advanced property for "Identity" and change existence checking to "check database". Although, this can be a slow and tedious process to have to keep hitting the DB.
    A little trick I use sometimes is to take advantage of the "readObject" API that will read the object from the databaes if it's not already in cache, and just return it from cache if it is in cache. Check out the UOW primer at http://otn.oracle.com/products/ias/toplink/index.html for more info, but the jist is that I would do this if I were you:
    x = some object that you're not sure is cached and you want to register in UOW;
    x' = uow.readObject(x);
    IF the object was in cache, you'd get back a working copy, nice and fast. IF it's not in cache, you hit the database, it goes in cache, and you get your working copy. Now you don't have to change the existence checking option which could slow everything down.
    - Don

  • Usage of Transaction Control Extension

    Hi there,
    is the PA Transaction Control Extension (PATCX) only good for EXTENDING Transaction Controls,
    or can it also be used to REPLACE Default Transaction Controls?
    Regards
    Nils

    Hi,
    Transaction types are used in several components in SAP, e.g. in CS
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/d7/07542843b911d189ee0000e81ddfac/frameset.htm
    Since, it's a more 'what is it?' question, you can esaily find the answer by searching 'Transaction type' on hep.sap.com.
    Regards,
    Eli

  • Transaction Control Error

    Hi,
    i am getting "Transaction Control Error" in newly created Client while executing any tcode. can you please give the solution for this.
    venkat

    Hi,
    i copied from 000 client to new client. it was successfully completed. After that if execute mm01 or mm02 transactions this type error i am getting. Can you please give the solution..
    venkat

  • Transaction Control

    Hi all,
    in order to use the transaction control in SAP which Active X control needs to be checked in Visual Basic.
    If any one worked on Transaction control pls let me know any literature which can be useful for me.
    have a nice weekend.
    Martin.

    9iFS supports this functionality in our next release 1.2 by giving access to the iFS JDBC connection in a server-side override. This is the only supported mechanism that can be used to perform custom database operations in the same transaction as fs operations.

  • Transaction control in ODE

    I want to use transaction control in ODE.
    Tried
    OracleTransaction txn = con.BeginTransaction();
    But got an exception saying " Specified method is not supported."
    Is there any other way around?

    The correct way to use transactions with .NET stored procedures is to start the transaction on the client side and commit or rollback this transaction after the stored procedure returns. This is similar to how would you do it with PL/SQL stored procedures. Note that ODE does not support anonymous transactions.

  • Transactional control statements in trigger

    Hi,
      Transaction Control statement, which cannot be executed within a trigger body??why...explain with reason
    its helpful me..

    Ishan wrote:
    "a way you can actually make it work" .... seriously?
    Yes, I was serious. Why? What's wrong with that? Technically speaking, won't it work?
    This is not a way to make it work, it's a way to break an application/process
    Well !!! All the cases?
    Here's  a scenario
    I want to audit a table where if any change done by the user has to be tracked in an audit table, irrespective whether the change has now been rolled back in the main table. I want to see what change was done? How would I do it? Going by your logic of breaking application/process, I should never use trigger as  AUTONOMOUS_TRANSACTION. Am I right? How would I achieve it now?
    Your auditing/tracing code should be in a separate procedure and that procedure should be autonomous, so that the requirement to write autonomous data for that purpose is kept isolated from the trigger code.  Consider this scenario instead.  You want to write audit/trace information from your triggers, so you make the trigger autonomous and put in your code to write the audit/trace information.  Later on, someone who hasn't a clue comes along and decides they need to do something else in that trigger (well why write a new trigger when one already exists?) and they get it to write some data in relation to the data being created by the trigger.  Now you suddenly have a transactionally unsafe application, where this 'child data' can still be written and committed even if there's a problem in the main transaction.  By isolating auding/tracing away to it's own autonomous procedure, you make it clear that it's only the auditing/tracing that should be autonomous and prevent any problems from occuring inside the trigger itself.
    That's more of a way to write bad code that is transactionally unsafe and demonstrates a lack of understanding of database transactional processing or how the rdbms on the server processes commits and could potentially lead to write contention in the writer processes, of which many would be spawned if the number of inserts (in this example) was high.
    The above comment is based on the assumption(which, I never stated) that in whatever scenario my code would be implemented, it would ALWAYS break the process. There are scenarios where this code could be required.
    Here's a link from Oracle Documentation, that uses an example of creating a trigger with AUTONOMOUS_TRANSACTION. If it is a so bad example which "demonstrates a lack of understanding of database transactional processing", why would Oracle even mention it in their documentation?
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14261/sqloperations.htm#BABDHGAB
    And the answer is because there is a way to do it and it could actually be required, even though it's rare.
    I just showed OP, that it's not allowed directly and if required, it can be done as there is a way to do it. When to do it and what could be the consequences was never the scope of the question.
    Yes, and there's ways to jump off cliffs and kill youself, but I wouldn't recommend demonstrating how to do that to people just because it's possible.
    Just because it's in the oracle documentation doesn't always mean it's best practice.  A lot of the documentation was written a long time ago and best practices have changed as well as further functionality added, and Oracle has been known to make mistakes in their documentation too.  However in this example, it's using it for auditing purposes, so the idea was almost there, but they still haven't met best practices of keeping the auditing isolated, so their example is not the best.

  • Status Profile: Business Transaction Control Config (OK02)

    Hi All,
    I would need to know the use of the options 'no actions', 'set' and 'delete' under the Business transaction control in Status Profile (User Status)  --> you will need to double click on each of the statuses to view the Business Transaction Control - they are the last 3 columns.  Please provide specific example as well. 
    Also, could you help to advise the relevance of the 'lowest' and 'highest' columns in the initial screen?  Please also advise the relevance of position and priority as well. 
    I am really having difficulty understanding the definition from SAP for both items.
    Thanks!
    Vivian

    Hi VP,
    Thanks for your reply.  Just a little clarifications.
    Yes, the transaction code is OK02, sorry for the typo.  For the 'Set' User Status, if below is my actual config:
    OK02:
    Status 10 - IDEN
                                     Influence               Next Action     
    Bus Trans               No Influence        Allowed      Warning     Forbidden      No Action     Set Status       Delete Status
    Complete                                          X                                                             X
    Confirm WBS                                    X                                             X                 
    Confirm order                                    X                                                             X
    Lock                                                X                                                             X
    Lock assignment                              X                                                             X
    Lock budgeting                                X                                                              X
    Lock dates                                      X                                                              X
    --> now let's say the WBS is currently set as status 10 IDEN.
    a). if someone suddenly do 'complete' (this is not a system status right?). as it is indicated as 'Set Status', what status will be set? user status or system status? What will be the value for the status to be set?
    a). if someone suddenly do 'confirm WBS' (not a system status right?). as it is indicated as 'Set Status', what status will be set? user status or system status? What will be the value for the status to be set?
    Also, may I know where I can see list of system status?System status cannot be defined / added by user right?
    Vivian

  • Business transaction Control in status profile.

    Hi Friends,
    Can anyone please explain me? in tstaus profile we maintain status and then in status we create new entries for Business transaction Control.
    Please explain me the below maintion each if possible in detail.
    Change configuration data
    Complete
    Create billing document
    Create delivery
    Create inquiry
    Create quotation
    Create sales document
    Goods issue delivery
    Incoming invoice
    Incomplete req. configuration
    Lock
    Material assembly
    Material purchase order
    Material purchase requisition
    Param. Effectivity Val. Assgmt
    Post goods issue
    Unlock
    reply awaited.
    Reagrds/ashu

    Hi,
    Status Profile:
    Eg
    You want pricing for a certain sales order type to be checked before billing is possible. You can do this by specifying that the document automatically receives a self-defined status which prevents billing.
    Actions
    1. Define a status profile.
    2. Assign one or more statuses to the status profile.
    3. Determine for each status whether it is to be set automatically or manually when creating the document.
    4. Define for the status which business functions should be suppressed or at least accompanied by a warning message.
    5. Now assign the status profile to a document type or an item category, for which status management should be active.
    Based on each status u can allow or restrict the documnets that would want to system to either create, give a warning, or simply ignore.
    Hope it helps you.
    If it does reward points for contribution.
    Regards
    Ravi

Maybe you are looking for