Transaction Handling

Hi,
Can someone please point me to documentation on how transactions are handled or should be implemented? Specifically, I am developing an application that uses Java function activities and want to understand what my responsibilities are when developing the activity code. In addition, if a workflow is kicked off by an external application, does that application have responsibility for transactionality?
Thank you.

For OWF 2.6.2 you can look at chapter 7 "Standard API for PLSQL Procedures Called by Function Activity"
You'll discover that you cannot commit or rollback your statements (maybe you can try on a AUTONOMOUS_TRANSACTION)
If you are writing function activity in
Java (External Java) I think you will have your own connection to the database, so you will commit or rollback as you like...
Hope this helps
Bye!

Similar Messages

  • Transaction Handling - JDBC Receiver Adapter - Multiple SP Calls

    Hello,
    I have the following scenario:
    I send an XML-SQL structure with multiple statment elements (each of them calling a different stored procedure). A stored procedure raises an error back to the JDBC Receiver Adapter in case of error.
    Is it possible to have transaction handling in the JDBC Receiver to ensure:
    - Commit only after ALL stored procedures where succesful (no error risen during calls)
    - Rollback of ALL already called stored procedures in case an error has been risen
    How can I implement these requirements in the JDBC Receiver Adapter?

    One more comment, I have found the following info for JDBC Drivers:
    <i> "JDBC driver's default is to autocommit, meaning that the result of every SQL statement is permanent as soon as it is executed. This is why the course hasn't had to be concerned with transactions so far, and is perfectly acceptable in many cases."</i>
    So I think that each SP-Call is automatically commited in case autocommit on JDBC Driver Level is set to "true". Does anyone know where I can change these settings? Directly on JDBC Receiver Adapter or do I have to go to Visual Admin for those changes?

  • Transaction Handling in Forte

    I have a serious problem with Forte Transaction handling.
    If a transaction gets aborted through the statement Transaction.Abort
    (not because of a database exception), looks like some resources/locks
    are not released as a result of which if the current screen is closed,
    Forte does not allow the screen to be re-opened. It gives some vague
    error like 'Incorrect syntax near '.'
    Following is the piece of code. I would appreciate it if someone could
    give me a solution.
    Thanks,
    Begin Transaction
    commitFlag = true;
    Function1(commitFlag);
    if commitflag
    Function2(commitFlag);
    end if;
    if NOT commitflag
    ex :UserDefinedException = new;
    Transaction.Abort(ex,true);
    end if;
    Exception
    When ex : UserDefinedException do
    End Transaction;
    Function1(commitFlag In/Out)
    SQL Select some_flg from some_tab;
    If some_flag = 'A'
    ex : UserDefinedException = new;
    commitFlag = false;
    raise ex;
    end if;
    update some_tab with some_flg;
    Exception
    when ex:UserDefinedException do
    Function2(commitFlag In/Out)
    SQL Select some_flg from another_tab;
    If some_flag = 'A'
    ex : UserDefinedException = new;
    commitFlag = false;
    raise ex;
    end if;
    update another_tab with some_flg;
    Exception
    when ex : UserDefinedException do
    }

    Transaction processing in FORTE is not straight forward. The wrong order
    of statements may break your code. In your example I can suggest to
    remove exceptions processing blocks from methods Function1 and
    Function2. If transaction aborts in Function1, Function2 won't be
    executed, so you don't need to use your commitFlag. You should process
    an exception what is generated by transaction.abort in the same method
    where transaction started or higher, otherwise it does work properly.
    Hope it helps.
    Igor Teselko.
    RAO Meena wrote:
    >
    I have a serious problem with Forte Transaction handling.
    If a transaction gets aborted through the statement Transaction.Abort
    (not because of a database exception), looks like some resources/locks
    are not released as a result of which if the current screen is closed,
    Forte does not allow the screen to be re-opened. It gives some vague
    error like 'Incorrect syntax near '.'
    Following is the piece of code. I would appreciate it if someone could
    give me a solution.
    Thanks,
    Begin Transaction
    commitFlag = true;
    Function1(commitFlag);
    if commitflag
    Function2(commitFlag);
    end if;
    if NOT commitflag
    ex :UserDefinedException = new;
    Transaction.Abort(ex,true);
    end if;
    Exception
    When ex : UserDefinedException do
    End Transaction;
    Function1(commitFlag In/Out)
    SQL Select some_flg from some_tab;
    If some_flag = 'A'
    ex : UserDefinedException = new;
    commitFlag = false;
    raise ex;
    end if;
    update some_tab with some_flg;
    Exception
    when ex:UserDefinedException do
    Function2(commitFlag In/Out)
    SQL Select some_flg from another_tab;
    If some_flag = 'A'
    ex : UserDefinedException = new;
    commitFlag = false;
    raise ex;
    end if;
    update another_tab with some_flg;
    Exception
    when ex : UserDefinedException do

  • Removing the entity object commit from transaction handler

    Hi,
    The business reuirement of the OAFWK page developed by us is as explained below:
    The basic functionality is of updating the attributes of items attached to the change order.
    The UI components displayed in the page(Item attribute changes region) are built based on the properties of the item attributes as LOV,poplist,textbox etc..
    The dynamic VO mapped to these UI components is based on a standard entity object.
    User operation:Select any attribute group and click on Go button.The Item attributes of the attribute group are displayed.Enter values in the Item Attributes and click on Apply button of the region.(changes made in the attributes related to the attribute group are committed to the database using
    &lt;Root AM&gt;.getTransaction.commit()).
    Now we have two such regions in the same page.
    On top of the page the item attributes of _{color:#800000}&lt;Item Type X&gt;{color}_ are displayed.
    Down the page, the item attributes of {color:#0000ff}&lt;_Item Type Y_&gt;{color} are displayed.
    In few special cases i.e for few item attributes, on click of Apply button for {color:#0000ff}_Item Y_{color} , the attributes of {color:#800000}I_tem X_{color} are to be updated by calling a PLSQL API.When Apply button in the Item attributes of _{color:#0000ff}Item Type Y{color}_ is clicked,the execution of controllers is :
    1.Controllers of Item attribute changes region of {color:#800000}&lt;Item Type X&gt; {color}The dynamic VO is built for the item attributes of Item Type X
    2.Controllers of the Item attribute changes region of {color:#0000ff}Item Type Y{color} The dynamic VO is built for the item attributes of Item Type Y.In the last controller of the hierarchy, the PLSQL API call is included(by invoking the method in AM) to update few attribute values of {color:#800000}Item Type X and finally &lt;Root AM&gt;.getTransaction().commit().
    Problem : The updated values by PLSQL API for {color:#800000}_Item Type X_{color} are not reflected in the database but indeed the values entered by user for {color:#800000}_Item Type X_{color} in the top of the page are committed(The Apply button for {color:#800000}_Item Type X_{color} is not clicked).
    _&gt;&gt;Please note that the dynamic VOs of both the Item Types are built on the same standard Entity Object_
    I am struggling to know the reason why the values updated by PLSQL API are overwrittem by the values in the entity object even though the PLSQL API is called in the last controller of execution.Please let me know if there is any OAFWK constraint.
    I tried the approach of removing the commit of the dynamic VO built in the region of {color:#800000}_Item Type X&gt;_ {color}{color:#000000}I fetched the entity implementation of the dynamic VO row and used removeandRetain(),revert().But this approach failed.I am referring to the jdevdoc for the built-in methods.
    {color}
    Now the requirement is the latest values updated by API (for {color:#800000}_Item Type X_{color}) should be committed in the database but not the values updated by the entity object for {color:#800000}_Item Type X_ {color}{color:#000000}in the item attributes region{color}.
    There should a single commit for the entire transaction of the page.
    Is there any chance to remove the commit of item attributes of {color:#800000}_Item X_{color} alone from the transaction handler?There are few methods in oracle.jbo.server.EntityImpl class such as doRemoveFromTransactionManager().But these methods are either protected or private.So classes of other packages cannot access them.
    So pelase suggest me if there is a workaround for this scenario.
    Thanks and Regards,
    Kiran
    Edited by: Kiran.A on Sep 20, 2008 3:34 AM

    Hi Sumit,
    Yes I agree on that front that updating the same record through PLSQL and EO is not the right approach.
    But the business requirement is as such and we do not have any workaround for this.
    Please let me know if there is any way to avoid the EO commit by removing from transaction listener.
    Regards,
    Kiran

  • Is ths Transaction Handling Write or Wrong ?

    I little bit hesitate about Transaction handling in my application. I want to add data to database, before do this following steps should happen
    # add data to account table
    # update account serial which locate another table
    # add data to monthtrm table
    # update monthtrm serial which locate another table
    In order to success this step I used container manager transaction below show that code
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
        public void addNewFixDepositAccount(Account account, String cusId, String branchCode, int newSerial, String userCode) {
            try {
              //add data to account table
              this.create(account);
                    //update the SystemParameter table with new saving serial
                    systemParameterFacade.setFdSerial(newSerial);
              //add data to monthtrn tabel     
              monthTrnFacade.create(monthTrn);
                    //update the SystemParameter table with new monthtrn serial
                    systemParameterFacade.setTrnSerial(nxtTranSerial);
         } catch (CopException e) {
         if (e.getStackTrace().length > 0) {
                    System.out.println("Custom Massage :-" + e.getMessage());
                    System.out.println("Called Class :-" + e.getCalledClass());
                    System.out.println("Exception Handling Class :- " + getClass());
                    System.out.println("Calling Method :-" + Thread.currentThread().getStackTrace()[1].getMethodName());
                    System.out.println("Called Method :-" + e.getCalledMethod());
                    System.out.println("Exception Line Number :-" + e.getStackTrace()[21].getLineNumber());
                    System.out.println("Date and Time :- " + e.getDateTime());
                    System.out.println("Exception Type :-" + e.getCause().toString());
                } else {
                    System.out.println("Custom Massage :-" + e.getMessage());
                    System.out.println("Called Class :-" + e.getCalledClass());
                    System.out.println("Exception Handling Class :- " + getClass());
                    System.out.println("Calling Method :-" + Thread.currentThread().getStackTrace()[1].getMethodName());
                    System.out.println("Called Method :-" + e.getCalledMethod());
                    System.out.println("Date and Time :- " + e.getDateTime());
                    System.out.println("Exception Type :-" + e.getCause().toString());
    }   Add data to account
        public void create(Account account) throws CopException {
            try {
                em.persist(account);
                em.flush();
                em.clear();
            } catch (Exception e) {
                context.setRollbackOnly();
                throw new CopException("Can't Add Account", e, getClass().toString(), Thread.currentThread().getStackTrace()[1].getMethodName());
      Add data to monthtrn
        public void create(MonthTrn monthTrn) throws CopException {
            try {
                em.persist(monthTrn);
                em.flush();
                em.clear();
            } catch (Exception e) {
                context.setRollbackOnly();
                throw new CopException("Can't Add MonthTrm", e ,getClass().toString(),Thread.currentThread().getStackTrace()[1].getMethodName());
    Update Account serial
        public void setFdSerial(int fdSerial) throws CopException {
            try {
                Query query = em.createQuery("UPDATE SystemParameter s SET s.fdSerial = :fdSerial");
                query.setParameter("fdSerial", fdSerial);
                query.executeUpdate();
                em.flush();
            } catch (Exception e) {
                context.setRollbackOnly();
                throw new CopException("Can't Update FD Serial", e, getClass().toString(), Thread.currentThread().getStackTrace()[1].getMethodName());
       Update Trnserial
        public void setTrnSerial(int trnSerial) throws CopException {
            try {
                System.out.println("Trn Serial : " + trnSerial);
                Query query = em.createQuery("UPDATE SystemParameter s SET s.trnSerial = :trnSerial");
                query.setParameter("trnSerial", trnSerial);
                int result = query.executeUpdate();
                System.out.println("Number of updated records in transaction Serial :- " + result);
            } catch (Exception e) {
                context.setRollbackOnly();
                throw new CopException("Can't Update Trn Serial", e, getClass().toString(), Thread.currentThread().getStackTrace()[1].getMethodName());
        }Exception Class
    package bank.exception;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import javax.ejb.ApplicationException;
    * @author dinesh
    @ApplicationException(rollback = true)
    public class CopException extends Exception {
        private String calledClass;
        private String calledMethod;
        public String getDateTime() {
            DateFormat dateFormat = new SimpleDateFormat(" yyyy-MM-dd HH:mm:ss");
            java.util.Date date = new java.util.Date();
            return dateFormat.format(date);
        public CopException(String string, Exception ae, String className, String methodName) {
            super(string, ae);
            this.getDateTime();
            this.setCalledClass(className);
            this.setCalledMethod(methodName);
        public String getCalledClass() {
            return calledClass;
        public void setCalledClass(String calledClass) {
            this.calledClass = calledClass;
        public String getCalledMethod() {
            return calledMethod;
        public void setCalledMethod(String calledMethod) {
            this.calledMethod = calledMethod;
    Is this way correctly handle Transaction? If I wrong please give me you're precious advice to improve my program efficiency, please give some comments

    Sounds fine to me. If you have duplicated yourself too much, you can refactor the model later to remove duplication. If there is no duplication, then separate models was the right choice.

  • Transaction Handling in webservice based partnerlink

    What is the transaction handling mechanism for parnerlink which calls webservice (not native BPEL/ESB)?
    REgards
    priyadarshi

    It is SDO using I think
    It should be not SOAP action, because it is not support transactions

  • Transaction handling in Siebel

    Hi
    Can I implement transaction handling in Siebel? If yes, how can I implement it?
    Thanks
    Gana

    This pdf give some background on transactions and error handling within esb 10g.
    http://www.oracle.com/technology/products/integration/esb/files/esb-transactions-errorhandling.pdf
    not very detailed

  • Transaction Handling across Procedures

    In the ODI Best Practice Guide for Data Warehouses I came across the following (page 100):
    "ODI procedures include an advanced mechanism for transaction handling across multiple steps or even multiple procedures."
    It states that transaction handling can occur across multiple procedures. I could not get this to work.
    I created a procedure with just one step that inserts into a table. In the step I have set the Transaction dropdown to Transaction 0 and the Commit dropdown to No Commit. However, when I execute the procedure the insert is committed as we terminate the session.
    Any ideas how this commit can be prevented?

    ok, I figured out that parameters to the JDBC driver can be specified at the properties tab of the data server.
    So I presume this will be autocommit = false or sth. similar
    I still have to try this out.

  • Osb 11g transaction handling

    Hi,
    I have a problem with transaction handling in OSB 11g. When I add a report action, error messages disappear.
    The process is the following:
    jms-queue -> proxy-service ->business-service ->EBS webservice.
    In the proxy-service I add an error-handler at node-level. In this error-handler I log the error-message in the server log. In the regular process there is a request and response-pipeline.
    When I add a message on the queue and when the response from EBS is negative, the message is placed on a errorqueue. That's ok.
    When I add a report-action to the error-handler and then I put another message on the queue, the message is disappeared. It is not on the error-queue and not on the normal queue. When I look in the database there is an extra row added.
    I use the default datasource(wlsbjmsrpDataSource).
    I found for example this blog: http://biemond.blogspot.nl/2010/11/global-transactions-and-quality-of.html ; but I can't find an example with writing to a database and a rollback to an errorqueue. The report-action needs it's own transaction.
    In the weblogic console -> datasources -> transaction I unchecked "Keep Connection After Local Transaction" but that didn't work.
    What kind of options is possible?
    Herman

    I cant believe i was answered by the famous Anuj!.
    You were correct. The weird thing, is that in publish actions the QoS is not propagated onto the target of that Publish per se.
    We say this, becouse the Local PS has the Transaction Required = True, ergo the QoS is Exactly Once all along its message flow. It also propagates in the service callout´s and Route Node´s. Thats why we, trying to avoid redundance, didnt specified it in the publish action.
    Thank you very much.
    Regards.
    Mario.

  • Transaction handling in EJBs

    i dont know ejb�s handle transaction.
    any sugesstions??????
    sorry my english, ciao

    http://www.google.com/search?hl=en&q=EJB+transaction+handling
    Especially look at this one:
    http://www.kevinboone.com/ejb-transactions.html

  • Web Service transaction handling

    Hello,
    Is it possible in SAP NW to execute several calls to Web Services in one LUW (logical unit of work)? And be able to commit or rollback?
    Where can i find information about Web Service transaction handling in SAP?
    Best regards
    Ute

    I haven't found any official info on it, but my simple testing (mainly via ST05) indicates that you should be able to call multiple web services within a single LUW -  there seems to be no implicit "commit work" issued by the framework (unlike remote RFC calls).
    Jonathan

  • Exception generated during defered local transaction handling

    Hi All,
    We are using data direct connect 3.3 driver with MS SQL Server 7 on WebSphere 4.0. We are getting the exception "Exception generated during defered local transaction handling". Anyone encountered similar problem?> please let me know the solution. I am pasting the stack trace here.
    Thanks in advance.
    Regards,
    Girish
    [7/29/05 9:19:31:210 EDT] 37c1f1 SystemOut U 2005-07-29 09:19:31,177 [Servlet.Engine.Transports:10] ERROR com.xyz.nuuw.bus.dao.JDBCWrapper -livdsqa11122643171177
    java.sql.SQLException: [IBM][SQLServer JDBC Driver]Exception generated during defered local transaction handling. See next exception via SQLException.getNextException for details.
    at com.ibm.websphere.jdbc.base.BaseExceptions.createException(Unknown Source)
    at com.ibm.websphere.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.ibm.websphere.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.ibm.websphere.jdbc.base.BaseConnection.transactionableWorkStarting(Unknown Source)
    at com.ibm.websphere.jdbc.base.BaseStatement.commonExecute(Unknown Source)
    at com.ibm.websphere.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
    at com.ibm.websphere.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
    at com.ibm.websphere.jdbcx.base.BasePreparedStatementWrapper.executeQuery(Unknown Source)
    at com.ibm.ejs.cm.cache.CachedStatement.executeQuery(CachedStatement.java:312)
    at com.ibm.ejs.cm.proxy.StatementProxy.executeQueryCommon(StatementProxy.java:410)
    at com.ibm.ejs.cm.proxy.PreparedStatementProxy.executeQuery(PreparedStatementProxy.java:53)
    at com.xyz.nuuw.bus.dao.JDBCWrapper.getdata(JDBCWrapper.java:164)
    at com.xyz.nuuw.bus.dao.AccountSetupPH.getKeyID(AccountSetupPH.java:445)
    at com.xyz.nuuw.bus.bo.AccountSetupBO.getKeyID(AccountSetupBO.java:50)
    at com.xyz.nuuw.accountSetup.bus.ejb.AccountSetupSBBean.getKeyID(AccountSetupSBBean.java:85)
    at com.xyz.nuuw.accountSetup.bus.ejb.EJSRemoteStatelessAccountSetupSB_14ea1086.getKeyID(EJSRemoteStatelessAccountSetupSB_14ea1086.java:99)
    at com.xyz.nuuw.accountSetup.bus.ejb._AccountSetupSB_Stub.getKeyID(_AccountSetupSB_Stub.java:310)
    at com.xyz.nuuw.bus.AccountSetupBD.getKeyID(AccountSetupBD.java:73)

    I am currently working with IBM on a similar problem with WAS 5.1 and SQL Server 2000. The SQLException has a nested exception that can be retrieved using the getNextException() method. This will give you some more information as to what is causing the problem. Ours seems to be triggered by a dropped connection at the SQL end. normally WAS will recover from that gracefully, but in our situation it is not.
    Doug

  • Multiple Stored Procs in Receiver JDBC with transaction handling

    Hi All,
    We have a requirement to call  two Stored procedured in Receiver JDBC -- such that if any one of those procedure fails it should rollback the transaction/ or in other words commit only when both are successful.
    Is this handled in Receiver JDBC adapter?
    Thanks,
    Himadri

    Hello KK,
    Combining is not an option available for us.
    Our requirement is there are two SPs. --  SP1 and SP2. SP1 is mapped from the header segment and called only once. SP2 is from Item segment and called multiple times based on number of items. If anyone of those calls fails the transaction should be rolled back.
    Is it possible in the standard JDBC call in PI?
    Thanks and Regards,
    Himadri Chakraborty

  • Transaction handling in XI

    hi guys;
    What I am trying to look is  XI tries to insert data in database and some error happens while inserting data so how xi rolls back the trasaction and how can we write a logic to send a email about this error to any  person.

    Mudit,
    <i>how can we write a logic to send a email about this error to any person.</i>
    You can create Alerts, which will trap all errors occuring in your process and send an email to the necessary person.
    To create alerts , this blog can help you out,
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    From SP14 onwards, activation of end to end monitoring is not needed for Alerting. Refer to this note 870232 for this info.
    If you are blow SP14, then also check this blog,
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    To send an EMAIL, assign an EMAIL ID to the corresponding user in the transaction SU01 and then set up SCOT and you can send emails when the ALERT is triggered.
    <i>some error happens while inserting data so how xi rolls back the trasaction</i> Internally , you can set the TRANSCATON handling of XI. Mostly, this transcation handling for errors dyuring insertion is handled by the Database itself.
    Regards,
    Bhavesh

  • 40EA1: Transaction handling for mySQL

    Hello out there,
    it seems that I cannot handle transactions with mySQL connections anymore.
    In older versions I could do something like this:
    /*sqldev:stmt*/begin;
    select * from dt_log;
    delete from dt_log where log_tsn=13068;
    /*sqldev:stmt*/rollback;
    Now these /*sqldev:stmt*/ hints do not work properly anymore. The first one seems to work. But the second one gives an error like this:
    SELECT command denied to user 'tsn'@'pc259.vu2k.vertriebsunion.de' for table 'all_tab_cols'
    Now, is this intended and if so, is there a way to use transactions on mySQL?
    Regards,
    dhalek

    This issue is solved in 4.0EA3.

Maybe you are looking for

  • Query on virtual cube showing incorrect values

    Experts, I have create a virtual cube on a base cube using services (info-source). both virtual as well base cube are z-development and are in BI. Base cube has 6 records, now when I check data in virtual cube using display data it shows correct valu

  • I can't update my iPad 1 from a downloaded iOS 5 download

    I own an iPad 1 running on OS 4.3. I have been trying to update directly fromiTunes without luck because the downloadlink breaks up during the update as aresult of internet instability. I thereafter downloaded the file " iPad1,1_5.0_9A334_Restore.ips

  • Using accented characters in text

    I'm trying to create a document using text for the Czech republic. I only need "dead" text to be in the Czech language, so am using text objects. Every time I try to paste the Czech words in (via notepad to clear any background Java), LiveCycle crash

  • ABAP Today's Inventory

    Hello ABAP developers, I need to calculate today's inventory for an specific material (from table MARA) How can I do this? Thanks, Ol Pom.

  • Repost: Problem in downloading a file from Portal Center

    Hi, I try to access the file http://toolsweb.us.oracle.com/pls/tools/docs/FOLDER/ROOTFOLDER/EIT/EITDOC/DOCDELIVS/DOC_DRAFTS/WEBDBDRAFTS/GS_SITE.ZIP but this server is inaccessible. I can't even ping it. could you please arrange it quickly ? Thanks a