How to rolledback the transaction in ejbStore()

we are using mvc-2 architecture.when i want to modify the employee details what we r doing is from controller it will goes to modifyEmployee method in sessionbean.as u can see in code we will setEmployeeMaster inturn it will call setEmployeeMaster in Entity bean ;we r using EJB1.1;
i am checking whether sizes of empcharges and deptcharges does not equal then throw exception and total transaction should be rollback.
At the time of reterving the count of two tables even data is not inserted in two tables in ejbStore() because ejbStore will be called by the container;after executing full methodthen only container is calling ejbStore where i am inserting data in two tables;
my requirment is i have to check whether in two tables any mismatch is going ;
how can i write this in this type of scenario?but while creating employee details i have to put same condition where ejbCreate will be called at that time transaction is rolledback.(when i say home     = (EmployeeEntityHome)ictx.lookup("EmployeeEntityBean");
remote     = (EmployeeEntity)home.create(); container is calling immediately ejbCreate);
in this case container is not calling immediately ejbStore when i say remote.setEmployeeMaster(employeeMaster);
i have written Pseudo code may be some errors are there;
Session bean
modifyEmployee(EmpMaster empMaster) thrpws MismatchException
try
*************other business processes******************
ictx     = new InitialContext();
home     = (EmployeeEntityHome)ictx.lookup("EmployeeEntityBean");
remote     = (EmployeeEntity)home.findByPrimaryKey(new Long(empMaster.empNo));
remote.setEmployeeMaster(employeeMaster);
*************other business processes******************
query1="select count(*) from empcharges where empno='*****'"
query2="select count(*) from deptcharges where deptpno='*****'"
rs=stmt.executeQuery(query1);
rs1=stmt.executeQuery(query2);
if(rs.next)
int cnt1=rs.getInt(1);
if(rs1.next)
int cnt2=rs.getInt(1);
if(cnt1 != cnt2)
flag =true;
if(flag)
throw new MismatchException("mismatch exception ");
catch(Exception e)
ctx.rollBackOnly();
EntityBean
public void setEmployeeMaster(EmployeeMasterDOB employeeMasterDOB)
          this.employeeMasterDOB = employeeMasterDOB;
          isDirty = true;
     public void ejbStore()     throws javax.ejb.EJBException
          try
if(isDirty)
                    isDirty = false;
                    EmployeeMaster EmployeeMasterDAO = new EmployeeMaster();
                    EmployeeMasterDAO.store(employeeMasterDOB);
               catch(Exception ex)
                    if(logger.isErrorEnabled())
                         logger.error(FILE_NAME+"[ejbStore()] -> "+ex.toString());
          throw new EJBException(ex.getMessage());
     EmployeeMasterDAO
     store(employeeMasterDOB)
               data will be inserted in empcharges and deptcharges tables...
     }

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

Similar Messages

  • How to change the transaction isolation level of a CMP?

    How to change the transaction isolation level of a CMP from SUN's Deployment Tool? So far I can't find any entry for this setting.

    Anuradha W wrote:
    That means, currently the only way tospecify the transaction level is through
    weblogic-ejb-jar.xml deployment descriptor?
    for WLS-generated code, yes.Somewhat related to this question, we have written a standalone testcase to reproduce this issue we have been having. Basically, the issue is that even though we configure the isolation level to a non-default one in the deployment descriptor, the connections returned by the datasource seem to be having the default (which is Read Committed). The DBMS is DB2.
    weblogic-ejb-jar.xml has the following set:
    <isolation-level>TransactionRepeatableRead</isolation-level>
    And we printed the isolation level of the connection returned from a method in the EJB, but the isolation level is still the default. I can share the code to reproduce the problem if you want to take a look at it. Please let me know how I can get that across to you.
    Thanks,
    AnuradhaIf you are using our JDBC driver for DB2, or can switch to it,
    just for a test, there is some debug I'd like from you.
    Joe

  • How to run the Transaction Code - BIC for Bank keys uploading

    Hi
    How to run the Transaction Code - BIC for Bank keys uploading.
    please give me suggestion.
    Thanks
    Indu

    Go to BIC transaction screen
    Fill the selection screen parameters as below
    1. Update Run (Test Run: Check Off: Real Run:Check On)
    2. Set Deletion Flag (Check On)
    3. Maximum no. of records: 999999
    4. Detail List (Check On)
    5. Display variant: 1SAP
    6. Presentation server (Select Radio Button)
    7. Application server (Deselcet Radio button)
    8. File name and Path: Select relavant file which is to be upload
    9. Bank country: If needed (Give respective country name)
    10. Select execute button or F8
    NOTE: Make sure that before executing run execute TEST RUN by deselecting Update Run check box
    Hope this will meet your requirement
    Thanks.

  • How to execute the transaction SCI

    Hi All,
    How to execute the transaction SCI
    Thank you,
    Sridhar.

    Hai ,
    there are two ways to use SCI , one is you open you code in se38 -->display mode --> Program >check>code inspector. here your program is executed with a dafault variant provided in SCI.
    Second method is go to SCI , create a inspection  an choose a variant , here system provide you with a wide range of program checks (security/syntax etc)
    For any further help.
    Do reply.
    Regards
    Jase

  • How to attach the transaction to the workitem.

    hi all,
    please suggest me how to attach the transaction code to the workitem.
    thanks in advance,
    Naval Bhatt

    hi,
    sorry my question was not clear.
    Its about the workitem in  workflow.
    we can attach the object to the workitem passing the object to the Adhoc objects
    can we attach some transaction too?
    thanks in advance
    Naval Bhatt

  • How many of the transactions woill be Roll backed?

    Hi friends,
    Could you please clarify That How many of the transactions will be rollbacked when we say ROLLBACK....?
    (For e.g., As a first transaction i used delete command to delete one row from a table of 10 rows....As a second transaction i used update command two times to update two records in the same table....Now i created one table ...after that i said rollback....So how many of the transactions will be rollbacked?)

    I'm sure blushadow has heard of all of those, but what does it have to do with the original question?
    SQL> CREATE TABLE t AS
      2  SELECT rownum id, TO_CHAR(TO_DATE(rownum, 'J'), 'Jsp') descr
      3  FROM all_objects WHERE rownum < 10;
    Table created.
    SQL> SELECT * FROM t;
            ID DESCR
             1 One
             2 Two
             3 Three
             4 Four
             5 Five
             6 Six
             7 Seven
             8 Eight
             9 Nine
    SQL> DELETE FROM t WHERE id = 1;
    1 row deleted.
    SQL> SAVEPOINT a;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Deux'
      2  WHERE id = 2;
    1 row updated.
    SQL> SAVEPOINT b;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Trois'
      2  WHERE id = 3;
    1 row updated.
    SQL> SELECT * FROM t;
            ID DESCR
             2 Deux
             3 Trois
             4 Four
             5 Five
             6 Six
             7 Seven
             8 Eight
             9 NineI agree that at this point, I can rollback to any point in these three statements, however, as soon as I do:
    SQL> CREATE TABLE t1 (id NUMBER);
    Table created.then the savepoints are gone
    SQL> ROLLBACK TO b;
    ROLLBACK TO b
    ERROR at line 1:
    ORA-01086: savepoint 'B' never establishedNow, the documentation says "If you use a SET TRANSACTION statement, then it must be the first statement in your transaction.", and the very first DELETE starts a transaction. and the fact that:
    SQL> SET TRANSACTION AUTONOMOUS;
    SET TRANSACTION AUTONOMOUS
    ERROR at line 1:
    ORA-00900: invalid SQL statementis invalid, even if you could use SET TRANSACTION within an already started transaction. I suppose you could do:
    SQL> DROP TABLE t1;
    Table dropped.
    SQL> TRUNCATE TABLE t;
    Table truncated.
    SQL> INSERT INTO T
      2  SELECT rownum id, TO_CHAR(TO_DATE(rownum, 'J'), 'Jsp') descr
      3  FROM all_objects WHERE rownum < 10;
    9 rows created.
    SQL> COMMIT;
    Commit complete.
    SQL> DELETE FROM t WHERE id = 1;
    1 row deleted.
    SQL> SAVEPOINT a;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Deux'
      2  WHERE id = 2;
    1 row updated.
    SQL> SAVEPOINT b;
    Savepoint created.
    SQL> UPDATE t SET descr = 'Trois'
      2  WHERE id = 3;
    1 row updated.
    SQL> DECLARE
      2  PRAGMA AUTONOMOUS_TRANSACTION;
      3  BEGIN
      4     EXECUTE IMMEDIATE 'CREATE TABLE t1 (id NUMBER)';
      5  END;
      6  /
    PL/SQL procedure successfully completed.
    SQL> ROLLBACK to b;
    Rollback complete.but it seems like a lot of effort to get around something that you shouldn't be doing in the first place.
    John

  • How to find the Transaction Code??

    Yeah, How to find the transaction code?
    Lets say suppose I know the path of what I want to do, for example I wanna assign chart of deprecition to a company code. The path will be "<i> SPRO - financial accounting - asset accounting - organizational structures - assign chart of depreciation to comp code".</i>
    <b>
    Where can I find the transaction code for this path??</b>
    FYI : The transaction code for this particular example is OAOB

    create a SQ01 quickview query for table TSTC  or, even do a join for TSTC&TSTCT
    TSTC - Transaction codes
    TSTCT - Transaction codes texts
    if you want to see where some of the transactions are in the hierarchy you can use transaction "search_sap_menu"  or SPRO and use the binocular button to search

  • How to delete the Transaction Data in CRM

    Hi Gurus,
    I have a requirement to delete the Transaction Data in one Client.
    But Configuration should be as it is ?
    How can i over come this situation?

    HI.
    Do you mean refresh the client ? if that is the case, i think you are posting in wrong forum since this one is for People Centric User Interface. Try in   Customer "Relationship Management (CRM) - General & Framework".
    Best Regards.
    Armando Rodriguez.

  • How to hide the transaction menu of R/3 in case of transaction iViews

    Hi Friends,
    I have created a transaction Iview for R/3.
    As per the requirements i have to hide the R/3 menu where on the left we have execute transaction box to write the transaction code and execute.
    How can we achieve this
    Regards...Rohit
    email [email protected]

    Hi Rohit,
    have a look at this thread:
    Hide the command box in sap gui
    There is a registry key value you can change to disable the wingui transaction field.
    -Mikko

  • How to find the transaction code for the particular program or include

    Dear All,
    Please help me on this queary.
    1) How to find what is the transaction assigned for the particular Report
    2) How to find the particular include is used in which programs and also transaction codes
    I have one ZProgram that contains only includes no selection screen, I have to find where this program is used, in that one include is ther I would like to know in which program and in which transaction that is used,
    They have given ME9F, ME21N/22n, wheren this includle is calling.
    Please kinely help on this.
    Thanks and Regards,
    Muralikrishna

    HI
    1. you can find the transaction for your report by opening in se80. On the left side window it will show the transaction if there is any.
    2. to find in which programs particular inclue is called , just open include in se38 and press where used list icon. in the pop up window select programs.
    regards
    vijay
    reward points if helpful

  • How to determine the transaction type?

    Hello,
    I have a requirement to disable the user when the role string field on the usr form is empty. I set up a post update entity adapter to do that and it works fine.
    When I want to enable the user using the Enable button, the above post update entity adapter detects that the role string field is empty and the user is Active, it disables the user right back.
    So, I need to set up a pre-update entity adapter that can detect the type of transaction. If the transaction is to Enable the Xellerate User, then I will update the role string to a dummy value (as long as it's not empty) so that the Disable adapter doesn't get fired.
    Is this possible to do? Where can I find the transaction type information for a given Object?
    Thanks
    Khanh

    Thanks
    This is the information that i got :
    java version "1.4.2_07"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_07
    Java HotSpot(TM) Client VM (build 1.4.2_07-b05, mixed mode)
    from this i could make out that the jvm is client version,, but how do i determine which vendor has provided the jvm .

  • Change in Standard SAP menu : How to catch the transaction code!

    Hello,
    I have added a menu item 'More Help' to the standard SAP menu 'Help' which should navigate to URLs for the respective transactions. Suppose i am in transaction FB03 and click the 'More Help' menu, it should navigate to the URL mentioned in a table.
    My Problem is I have created a transaction for that menu item 'zhelp' which calls a program and when i am clicking the 'more help' tab , the original value of sy-tcode which should be FB03 is replaced with the new Transaction which is used for the menu item i.e. 'zhelp'. Because of this i am not able to retrieve my value from the table corresponding to the transaction FB03.
    Is there any other system field which stores the value of transaction FB03 aftter navigating to other transaction? How should i go ahead with this? Please help!!
    Edited by: Rojalin Priyadarshiny on Sep 10, 2009 3:45 PM

    Hi,
    I really dont know in how many standard transactions you have added the More Help option.
    If you hav added only in 2  to 3 transactions then you can think on using the below Logic.
    Say if u have added in  FB01, FB02 and FB03 transaction.
    Find one exit for each transaction, in the exit EXPORT TCODE ( EX: FB01 ) to memory.
    In your Ztransaction report IMPORT the TCODE from memory.
    Now u will get FB01 after inmport statement and u can make use of this.
    If the option is added in many transactions , you have to think again in using the above logic as it involves identification of many Exits.
    Regards,
    Sravan

  • How to Tune the Transactions/ Z - reports /Progr..of High response time

    Dear friends,
    in <b>ST03</b> work load anlysis menu.... there are some z-reports, transactions, and some programmes are noticed contineously that they are taking the <b>max. response time</b> (and mostly >90%of time is  DB Time ).
    how to tune the above situation ??
    Thank u.

    Siva,
    You can start with some thing like:
    ST04  -> Detail Analysis -> SQL Request (look at top disk reads and buffer get SQL statements)
    For the top SQL statements identified you'd want to look at the explain plan to determine if the SQL statements is:
    1) inefficient
    2) are your DB stats up to date on the tables (note up to date stats does not always means they are the best)
    3) if there are better indexes available, if not would a more suitable index help?
    4) if there are many slow disk reads, is there an I/O issue?
    etc...
    While you're in ST04 make sure your buffers are sized adequately.
    Also make sure your Oracle parameters are set according to this OSS note.
    Note 830576 - Parameter recommendations for Oracle 10g

  • How to Set the Transaction Isolation Level in WebLogic?

    Is there a way to set the transaction isolation level in WebLogic 9.2 or WebLogic 10?
    For an example say, we have an application which is supported for several database platforms. Without setting the transaction isolation level in DBMS level, is there a way to specify this in WebLogic to make it common for all the DBMS type?
    And I found a way to change the transaction isolation level in WebSphere application server using a property called webSphereDefaultIsolationLevel.
    [url http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21224492]http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21224492
    Is there a way to do the same thing in WebLogic application server 9.2 or 10?

    Anuradha W wrote:
    That means, currently the only way tospecify the transaction level is through
    weblogic-ejb-jar.xml deployment descriptor?
    for WLS-generated code, yes.Somewhat related to this question, we have written a standalone testcase to reproduce this issue we have been having. Basically, the issue is that even though we configure the isolation level to a non-default one in the deployment descriptor, the connections returned by the datasource seem to be having the default (which is Read Committed). The DBMS is DB2.
    weblogic-ejb-jar.xml has the following set:
    <isolation-level>TransactionRepeatableRead</isolation-level>
    And we printed the isolation level of the connection returned from a method in the EJB, but the isolation level is still the default. I can share the code to reproduce the problem if you want to take a look at it. Please let me know how I can get that across to you.
    Thanks,
    AnuradhaIf you are using our JDBC driver for DB2, or can switch to it,
    just for a test, there is some debug I'd like from you.
    Joe

  • How to find the transaction type in our program

    dear sir,
              in solution manager in that crmd_order there are 4 transaction type (SLF1 SLFN SLFD SLFH) .. now i want to validate one field in standard screen in that t-code crmd_order . but the same screen used in all transaction type (SLF1, SLFN,SLFDand SLFH ) i want to validate that field only if the transaction type is SLF1 or SLFN otherwise no need .. so i want to check if transaction type is SLF1 or SLFN in my program .. so now i need transaction type .. so how how capture type in our program ( not SY-TCODE ) is stored in any system variable..
    Regards
    kumar

    hi siva velma,
    thank you fro your answer.
    how i conclude that when i see the where list which table is the actual table i need.
    please make me understand that.
    what about the ordre types ..in crm how we have them..for complaints , returns, sales order etc.in r/3 we have re for returns, or for std sales order.
    there so many sales orders which one i should take.
    there are so many transaction types for complaints cmrr,cmrp,dmrb etc - for complaints.which is for what how i wil know.
    <b>if i want to print the out of a output list how do i do that .pl tell me the spool settings.the printer settings.</b>
    thank you,
    hun<b></b><b></b>

Maybe you are looking for

  • Problem with a transport order

    I release a transport order in DEV, I want to change the Target System because this field is initial (Local Change Requests). I want to tranport de order to QAS, I can't change the order when it is released. How do I to undo the release? Best Regards

  • Need a array within an arraycollection for the arraycollection to run the filterfunction properly?

    Do you need to have an array within an arraycollection for the arraycollection to run the filterfunction properly? <mx:ArrayCollection id="arrColl"> <mx:source> <mx:Array> <mx:Object name="ColdFusion" value="0.00" /> <mx:Object name="Dreamweaver" val

  • Top aligning HtmlDataTable components in a HtmlPanelGrid

    I need a recommended solution for this scenario. I have three h:dataTable components in a h:panelGrid as follows: <h:panelGrid columns="3">                 <h:dataTable value="#{fooBean1.myList}" var="list">                            <h:outputText v

  • Just got a replacement for my ipad today and look what i got instead

    so my iPad had a dead pixel in the top and i was also getting dust under the glass for some reason, so i went to the apple store in fifth ave here in manhattan and got a replacement, the replacement has a worse problem , look at this picture and you'

  • One button controlling multiple buttons as3

    I'm trying to follow a tutorial I found online for a randomly selected image without using an XML or AS file. The problem is that I want to generate more than just one section, like generate an image from one group, and an image from another group, a