How to create transaction in web tier

Hi everyone;
I have a problem with cmt session bean methods.I'm using user transaction interface at servlet.How can i joining cmt methods in existing transaction which is created by web tier.
I tried this code for my aim but it didn't work properly it gives an error.
The errors is=IllegalStateException.
Context context = new InitialContext();
UserTransaction userTransaction =
(UserTransaction) context.lookup("java:comp/UserTransaction");
userTransaction.begin();
// Perform transacted tasks.
userTransaction.commit();My session beans are cmt and transaction scoped persistence context and stateless.Is it possible to use user transaction interface with cmt methods.
Please give me an advice how can i overhelm this problem,i'm looking forward to hearing your suggestions.
Faruk Namlı

java.lang.IllegalStateException
at com.sun.jts.jta.TransactionManagerImpl.rollback(TransactionManagerImpl.java:346)
at com.sun.enterprise.distributedtx.J2EETransactionManagerImpl.rollback(J2EETransactionManagerImpl.java:1150)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.rollback(J2EETransactionManagerOpt.java:433)
at com.sun.enterprise.distributedtx.UserTransactionImpl.rollback(UserTransactionImpl.java:225)
at com.columbus.teienPortal.insertion.EnterNewDocAction.execute(EnterNewDocAction.java:65)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:599)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:92)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
|#]
[#|2010-03-03T10:31:45.331+0200|WARNING|sun-appserver2.1|javax.enterprise.system.stream.err|_ThreadID=23;_ThreadName=httpSSLWorkerThread-8080-3;_RequestID=0c350e31-426a-4fb4-b066-461a2268a18b;|
javax.transaction.RollbackException: Transaction marked for rollback.
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:449)
at com.sun.enterprise.distributedtx.J2EETransactionManagerOpt.commit(J2EETransactionManagerOpt.java:371)
at com.sun.enterprise.distributedtx.UserTransactionImpl.commit(UserTransactionImpl.java:197)
at com.columbus.teienPortal.insertion.EnterNewDocAction.execute(EnterNewDocAction.java:58)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doChainInvoke(StandardPipeline.java:599)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:92)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
|#]
i want to execute more than one cmt methods in web tier in one transaction.
if i insert data correctly to all,commit operation will be successfull.
But,when the transaction need roolback,it throw above exceptions.

Similar Messages

  • How to create transaction for a maintenance view, Thank you.

    How to create transaction for a maintenance view,
    Thank you.
    deniz...

    Hi Deniz,
    Go to se93.
    Then create the new T.code.
    Under that select parameter Transaction.
    Then give the sm30 in the t.code in default values tab.
    check the checkbox skip initial screen.
    in classification tab.
    click checkbox inherit gui attributes..
    Now below..
    In the default values..
    select
    viewname and give ur table name.
    UPDATE= Xsave
    view - table name ( Should be upper case
    update X ( should be upper case).
    http://www.sap-basis-abap.com/sapbs011.htm
    Hope this helps you.
    Regards,
    Viveks

  • How to create t-code for a table and how to create transaction variant???

    Hi,
    I have created a custom table zsark.
    Now my requirement is : I have to create a transaction variant zsark_var for sm30 and table zsark. I have to disable the output of the first screen. I have to assign the transaction variant to the transaction code of table zsark.
    Now,
    1.     how to create transaction code to a table. Can any one give me the 
                    staps??
    2.     how to create transaction variant for the above requirement???
    Thanks & Regards,
    Sarkar

    Hi
    1 Goto SE93 transaction
    2 Choose 5th option Transaction with parameters
    3 Give transaction : SM30, Check Skip Initial Screen Press Enter
    4 Goto Bottom left corner, click F4 select viewname, on right hand side give table name
    5 Press one more time F4, choose update , mark it X on right side.
    6 save the transaction.
    Thanks
    sandeep
    reward if helpful

  • How to create transaction code for a Z-table

    How to create transaction code for a Z-table?
    Se93 --> then which radio button to be selected? and what is the program nam e to  be given

    Hi Sam,
    <b>Procedure to create a TCODE for ZTABLE:</b>
    Create a table maintainance/View for the Z* Table.
    Once you create the view goto SE93>Select Parameter transaction and give the short desc.>
    Give the transaction as SM30(Skip the first screen-optional)>Check all check boxes under GUI support>In the default values(grid)section first row give the VIEWNAME as you created initially and the second row UPDATE as X.
    <u><i>Se93 --> then which radio button to be selected</i></u>
    Select the parameter transaction as a radio button.
    <u><i>what is the program nam e to be given</i></u>
    no need to give any program name. Instead you have to give the transaction code name as SM30.
    Pls mark the helpful answers.
    Thanks
    Eswar

  • How to create transaction code for maintenance view

    hai friends,
    i hope every thing goes good.
    i have doubt, how to create transaction code for maintenance view. I created view for tranperant table and now i want to create transaction code for the view.
    i tried and i donot know the screen number and program name and where can i give the view name.
    if any one know please post in details.
    thanks in advance.

    Hi Elam,
    You need to create a "Parameter Transaction".
    What this means is that you will have a transaction (let's call it "ZMAINT") which calls "SM30" and passes in your table name.
    Go to transaction SE93 and enter your new transaction code. Enter in the Tcode description and choose "Transaction with Parameters" (it shouldbe the last radio button).
    Enter in the default transaction "SM30" and tick the "Skip Initial Screen" check box. Hit Enter.
    Now scroll to the bottom of the screen and you will see a Table Control where you will need to enter in the values to the SM30 selection screen.
    Because you hit ENTER, the program will have loaded in the Selection Screen parameters into it's memory. Hit the drop down for "Name of Screen Field" and select "VIEWNAME" and then enter in your Z Table in the "Value" column.
    Now go to the next line and hit the drop down and select "UPDATE" in the "Name of Screen Field". Enter in a "X" in the value column.
    Now save the transaction and there you have it.
    Hope this helps.
    Cheers,
    Pat.
    PS. Kindly assign Reward Points to the posts you find helpful.

  • How to create Transaction code for ABAP and execution by other user

    Hi All,
    Could someone please let me know how to create transaction code in detail for ABAP program. Step by step procedure expected. I would like to know how other user can execute the report using same transaction code which I have created.
    More about authorization.
    Thanks in advance.

    Hello,
    You can create transaction code from se80 as well.In object navigator,right click on your program name and create->transaction code.You can create transaction and select if it is only a report,a report with selection-screen depending on your requirement.You can run your report directly by entering the transaction code in the command field.
    You can authorise the users who can use your transaction:
    <b>Authorisation objects</b> are used to restrict certain transactions to users.Critical data must be protected from unauthorised users.For example,the head has access to certain data.But it cannot be accessed by his subordinate.For this we need to define <b>roles</b>.
    •Create an authorization object with transaction SU21.
    An object usually consists of the ACTVT (activity) field and one other field,which specifies the data type to be protected.By ACTVT, we can decide if the data is accessible for change,display only etc.
    •Add authorization fields to the authorization object created.
    •Assign the authorization object to the transaction using SE93.
    Attach the authorization object to the role using transaction PFCG.
    If you want <b>to assign roles</b>,use transaction PFCG.Create a new role.In the AUTHORIZATIONS tab,you can get a self generated profile name and a profile text by clicking on the icon next to it.Then go to the "Change Authorization data" and choose an authorization template.Then you can choose to display/change/create an activity and after the selection,click on the red and white circle.The profile will now be created.
    In the user tab,you can give the user details who can use this role.
    <b>Also check this link:</b>
    http://www.*********************/r3_security/r3_security_tips.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/52/6716a6439b11d1896f0000e8322d00/content.htm
    <b>Very helpful guide:</b>
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c
    Regards,
    Beejal
    **Reward if answer is helpful

  • How to create  calendar in web dynpro abap

    Hi ,
    how to create  calendra in web dynpro abap.
    Thanks in advance.
    Regards, Chetan

    hi,
    For calender control, there is Date Navigator under "complex tab". You can just click and drag it and provide calender control.
    One more easy way is to create a input field. In the context, create a node and attribute of type "D"(which means DATE). And bind the context to your input field under "values" in property window. While running the program, you will see an calender attached to lt on the input field.
    Regards,
    Jithin

  • How to create local virtual web host ex. myserver.local?

    Hi
    I'm sorry but following steps in Yosemite Server help led me to nowhere.
    Could you please explain how to create local virtual web host ex. myserver.local?
    Thanks

    Hi Sergey,
    I assume that you mean virtual desktop storage location, which I don’t think that we can change this setting for an existing collection.
    You can create a new collection, during the creation process, you will be able to select a different storage location for new VMs.
    More information for you:
    Single Image Management for Virtual Desktop Collections in Windows Server 2012
    http://blogs.msdn.com/b/rds/archive/2012/10/29/single-image-management-for-virtual-desktop-collections-in-windows-server-2012.aspx
    Geek of All Trades: VM-Hosted RemoteApps - New Best Practice for Virtual Desktops?
    https://technet.microsoft.com/en-us/magazine/jj554307.aspx
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How to Create and Deploy Web Services Using Oracle 9i JDeveloper

    Hi,
    My Question is how to create and deploy Web Services using Oracle 9i JDeveloper.Anybody please give me a detailed Reply.Please Reply to [email protected]
    Hopr to Hear From you,
    Regards,
    G Sreekumar

    You could use datasources. You should do this in your BC4J Configuration. Then when deploying your applicaiton use the command -installDataSource (from admin.jar) to create the right datasource.
    You could probably use the name of your connection + "DS" so you can also use it locally in JDeveloper as JDev seesm to create this automaticly for your Connections.

  • How to create transaction routine formula(ie, TOUPPER)

    how to create transaction routine formula(ie, TOUPPER)

    Hi Murali,
    Welcome to SDN!!
    Goto the transfer rules and select whichever info-object you want in upper case. You would options line constant, formula and routine. Select formula and enter as TOUPPER(). The incoming data for the info-object would be converted to upper case.
    Bye
    Dinesh
    (Assign points if useful)

  • How to create transaction for FM

    Hi All,
    Can anybody please let me know How to create transaction for FM which can direct run by passing value and return the result.
    I want to create transaction code for my function module.Please let me know how we can achieve that. tahnsk in adavance.
    Regards,
    Kalpana
    Message was edited by:
            kalpana k

    Hi,
    You can create transaction code for your FM. First create a report program in SE38. and call you FM as shown in below example.
    report Zxyz.
    constants: gc_viewname like dd02v-tabname value 'YFIT_COST_RATE'.
    start-of-selection.
      call function 'TABLE_CUSTOMIZING_MAINTENANCE'
           exporting
                tabname  = gc_viewname
           exceptions
                no_views = 1
                others   = 2.
      if sy-subrc <> 0.
        message a007(e2) with gc_viewname.
      endif.
    similar to this FM you can call your FM and you can write your processing logic after FM call.
    thanks,
    sksingh

  • How to create transaction table in R/3

    Hi Gurus,
                  I have created master data table in R/3 with zempid as a primary key. I need to create transaction table for employee and visitor. how can i relate 2 transaction table with employee master table while creating tables in R/3 SE11.
    Notes: both employee and visitor transaction table has zempid.
    please let me know how to create table with relations.
    Thanks & Regards,
    Bharath

    Hi,
    In a normal database (say Oracle), this referential integrity is taken care of by PK-FK (primary key - foreign key) relationships. As far as OLTP - SAP R/3 is concerned, these are exisitng for the tables defined by SAP.
    Speaking about BW:
    1. You will bring master data from R/3--> BW first (its always a good practice), which should mean that empid 1000 - 1007 will flow to BW. Also your OLTP system ensures that there can be no transaction data (due to PK-FK relationships), for any emp. id other than 1000-1007.
    2. There could be another case that when the master data has been transferred to BW, due to time lag, in between master data and transaction data are created in R/3... meaning thereby that R/3 now has both master data about say emp.Id 1008 and transaction data as well.
    3. Now the transaction data is extracted from R/3, which will bring the transaction data for 1008, eventhough the master data for 1008 (loaded in step 1) has not come down to BW.
    4. Such situation can be controlled in BW, there are options wherein you can control this. the options are:
      - Load data even if there is no master data (this will create master data record with key values and nulls in other attributes) - record for 1008 will get loaded in such cases.
    - Do not Load data when there is no master data - The record with 1008 emp. id will not be loaded in such a case.
    Hope this helps.
    Cheers,
    Sumit

  • How to create Transaction code for Table Maintanance generator.?

    Hi,
    I have created a Z Table. and I maintained the Table maintenance generator for the same. Now, my requirement is.. I have to create Transaction code for maintain and Display of this Z table.
    Can someone help me how to create the transaction code for Maintain and Display of the table. I know that we have to create a Transaction code for 'SM30'. Can someone tell me the steps to do the same. When I goto SE93 and say CREATE transaction, I get 5 options, Which one to select and what are the details should I provide in the subsequent screens.
    Thanks in advance.
    Best Regards,
    Paddu,

    Hi,
         Check the below steps......
    1. Go to Tcode u2018se93u2019.
    2. Select ' Transaction with parameters'.
    3. Then Transaction 'SM30' with click on skip initial screen
          VIEWNAME : XXX9tABLE NAME)
          UPDATE   : X
    4. Maintain the  Table maintenance generator
      Authorization group : &NC&
      Authorization object :
      Function group : name(xxx)
    Maintenance Screens :
    Maintenance type : One step
    Maint Screen No : Overview screen (2)
    If still u have problem I will send u steps with Screen shot ...send me Yr id.
    Regards,
    Biswanath

  • How to Create Transaction code for a Report

    Hi Gurus,
    I created some reports and I wants those reports
    should be placed in the SAP Menu(initial screen) not
    in the User menu in the form of Transaction codes.
    I would really appreciate if any one can please send the process to create transaction codes for the User reports/Report groups in R/3 and how to add those created Transaction codes to the SAP MENU.
    Thanks in Advance
    Danial

    Try to insert it into the main menu if you must change S000 (there is a function module for everything)? Perhaps SAP protects their menu trees from foreign subnodes in SE43?
    Also note that for report transactions you do not need to give the user transaction code start_report. If you do, then they could enter it directly and potentially start many other reports too. The system will call start_report for submitting the report internally without authorizations for it required (unless start_report is maintained in SE97).
    Regarding DE, this also confuses me sometimes and I noticed that it generally indicates that I am doing something which has an implication for a SAP standard object. Try either hitting the enter button to see what the next screen is, or, choose original language in the previous screen, or, logon in sy-langu = DE and (remember the path if you dont speak German) change it, or, follow JCs advice to create your own menu.

  • Create Transaction for web-dynpro ABAP

    hi
       Can you help me in creating a transaction for web-dynpro ABAP.
    thank you.

    If you want a SAPGUI transaction code that will launch your Web Dynpro ABAP application then I suggest creating a parameter transaction code that wraps around the SAP standard transaction code WDYID.  You can use the parameter STARTMODE to decide if you launch your browser within the SAPGUI window or if it opens a new browser window. You will get SAPGUI based Single Sign On with this transaction code as well.  Here is an example of a TCode I setup:
    http://www.flickr.com/photos/tjung/2758987559/
    And here is what it looks like when running in place within the SAPGUI:
    http://www.flickr.com/photos/tjung/2758987583/

Maybe you are looking for