Transaction Handling (URGENT)

I m facing this problem.
I have a bean which is CMT it's method(Ba) is being called from the client for which the Tx attrib is Required. which is calling same bean's method(Bb) which is running in RequiresNew Tx. The method (Bb) calls another session beans method(Sa) which is Required Tx.
Bb is also performing some DB operations. So if the Bb or Sa fails it should not affect Ba. Note that Ba is calling method Bb in a loop.
The problem is that if the exception occurs in method Bb's DB operations then the operations done in Sa gets commited.
Note : The method Bb is throwing EJBException on failure.Method Bb is using SQL stats for it's DB operations. Method Sa is using entity bean for it's operation. I am using weblogic 5.1
Any idea why this is happening
Thanks in advance
Sachin Shah

This sounds like something I've heard frequently. You need to catch the exception and call setRollbackOnly(). It is in the spec although some have complained about it.

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

  • Transactions tables (((urgent)))

    hi can we know the tables used by the transactions
    i have got the program name
    and then through se80 we can c the module pool
    but i want a diff way and i also dont want sql trace
    i want to know the tables used for co03.
    when i run this transaction co03
    and then in goto menu i choose cost---analysis
    then there is an alv grid
    i want to know the table fields not the structure fields related to that alv
    plz help
    it is very urgent
    thanx in advance

    Hi,
    the only way to find a table easily is to use ST05 - sql trace, why don#t you wanna use it ?
    Go to your transaction right before the point where you expect that the data
    is read from the DB, start SQL Trace andBuffer trace, in case the table is buffered,
    but usually they are not. Call the data in your transaction. Stop Trace and
    analyze protocol, CO table you'll find quickly cause they usually start with CO*,
    like cosp, coep, cost, etc.. .
    Kind regards
    Henner

  • 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

Maybe you are looking for

  • How do I find the date and time stamp on pictures?

    How do I find the date and time stamp for my pictures?

  • How do i move my husbands i phone off of my icloud and onto his own?

    My husbands i phone is on my icloud account. BIG mistake. i want to take his phone off of mine icloud accoutn and put him on his own. how do i do this?

  • Windows Media Player requests a licence.

    Playing a ripped CD in Widows Media Player, requests that I download a licence, but returns the following Error: your Netscape browser does not have "Microsoft® Windows Media Services" plug-ins installed. How can I resolve this?

  • Unlimited plan for iPad 2 in Puerto Rico?

    Well I want to know if I can get unlimited plan for my iPad 2 in puerto rico, because is not a option when I try to get it, just the option of 250MB and the other of 2GB, anyone know what I need to do to get the unlimited?

  • External Operation Processing

    Dear all, I'm using a external control key, I have an external service I want to perfom. How come I don't have a place inside the routing to indicate the service that I want like PM task lists? Also how is the purchasing department supposed to unders