Transaction handling between EJBs

hi,
I am having a delegate kind of Stateless Session Bean(SSB which calls three other SSBs and perform database operations. My delegate bean does not have any database activities associated with it.
I am using container managed transaction and setting transaction attribute for the business function calling the 3 SSBs as RequiresNew. I have set the transaction attribute for the other 3 beans as Required. But when there is a update error, the transaction is not rolling back. Have someone come across similar problem?
Thanks in advance.
Regards,
Karthik

An user exception (in the EJB spec. called application exception) must not be extend RunTimeException.
Hi crackers, here are some sentences from the EJB specification:
Code that you develop should not throw EJBException - that's "reserved" for the container vendor to signal a container failure.EJB Spec. 2.0 (page373):
If the bean method performs an operation that results in a checked exception[32] that the bean
method cannot recover, the bean method should throw the javax.ejb.EJBException
that wraps the original exception.
Not entirely accurate. If a user-defined Exception extends the Exception class, yes, you must explicitly rollback the transaction. However, if the user-defined Exception extends RuntimeException, the container will roll back the exception for you.EJB Spec. 2.0 (page372):
An application exception class must be a subclass (direct or indirect) of java.lang.Exception.
An application exception class must not be defined as a subclass of the java.lang.RuntimeException
or of the java.rmi.RemoteException.

Similar Messages

  • 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

  • What is the difference between ejb reference and ejb handle?

    Hi:
    I am newbie for J2EE.
    I want to know what is the difference between ejb reference and ejb handle
    from the client view and from the container view?
    Very Thanks!
    Stive

    Hi John,,
    1) Ejb Object Handle are nothing but a long lived proxy for the
    ejb object, using this handle user can disconnect from the Ejb Server/Container
    at any time
    and after some time using the same handle he can able to resume the conversational
    state
    with the server / container where he was been disconnected From.
    And there are currently two Handles , HomeHandle and Handle for EjbHomeObject
    and EjbObject
    Respectively. Both these handles have Persistent reference to the EJB Object
    2) Ejb Reference is used to lookup a bean from other Enterprise Bean
    Ejb reference is a nickname for the JNDI Location that you want to lookup a bean.
    your code will looks up a Home object via using this nickname
    and the deployer will bind the
    nickname to the JNDI location of its choice
    EJb Reference are declared in the deployment descriptor
    Regards
    Karthikeyan Gangadharan
    SIP Technologies, Chennai
    E-mail-ID : [email protected]
    "John Stive" <[email protected]> wrote:
    >
    Hi:
    I am newbie for J2EE.
    I want to know what is the difference between ejb reference and ejb
    handle
    from the client view and from the container view?
    Very Thanks!
    Stive

  • 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.

  • 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

  • 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

  • SFTP Seeburger adapter - Could not find channel for report handling between

    Hello Friends ,
    We have R3 -> PI-> SFTP scenario . The messages are transferred successfully and the file is successfully received at the receiving end . But when we do communication channel monitoring , we see errors in Receiver CC . The Reciever CC contains SFTP adapter (Seeburger) . Recently the Seeburger adapter is upgraded and the below error has started occuring then onwards .
    Error Message which we see in CC monitoring for Receiver CC (SFTP) is as below .
    Initiation of Transmission Report( job id: da405030-30c6-11df-8b6e-797b8921162c milestone: 290) failed! Exception occured: Error while preparing XI message. Error: Could not find channel for report handling between parties: fromParty, toParty: Itella) - com.seeburger.xi.connector.fw.ConfigurationException: Error while preparing XI message. Error: Could not find channel for report handling between parties: fromParty, toParty: Itella) [3/16/10 8:40 AM]
    Could experts help me ...
    Thanks for your time .
    Regards,
    Laxman Nayak .

    Hi,
    I also have the error you mentioned but we're implementing the Seeburger SFTP adapter for the first time.
    I've requested transport acknowledgements in my ABAP proxy and have checked the 'Deliver transmission report' flag in the adapter but I don't know what else I must do.
    Any help would be greatly appreciated.
    Thanks,
    Alan

  • 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

  • Differences between @EJB and @Resouce?

    Hi,
    I am confused about the differences between @EJB and @Resource?
    1.
    Can Session Beans be injected for both?
    If so what are the pro's / con's?
    2.
    Are the any difference between the type of components that cna be registered for one but not the other?
    3.
    Are they both equally usable with the ENC?
    Many thanks.

    @EJBs are 'special' resources. For example, @EJB (for a stateful session bean) results in
    1. Creation of the Stateful Session Bean,
    2. Other dependencies are injected into this newly created bean,
    3. If the bean has a @PostConstruct bean then that method is invoked (after invoking applicable interceptors)
    Hope this helps

  • Handling between in Case

    Hi All,
    How to handle between in Case?
    (case emp_type
    * when between 1 and 3 then '01'*
    * when between 2 and 4 then '04'*
    * when between 4 and 5 then '05'*
    * end*
    above statement is giving error.
    one way is:
    (case emp_type
    when emp_type between 1 and 3 then '01'
    when emp_type between 2 and 4 then '04'
    when emp_type between 4 and 5 then '05'
    end
    Any other solutions ?
    Thanks.

    Are you using SQL or PL/SQL?
    Your example isn't working in SQL...
    Your example looks like some mix?
    Can you post some sample data?
    MHO%xe> with emp as
      2  (select 1 emp_type from dual union all
      3   select 2 emp_type from dual union all
      4   select 3 emp_type from dual union all
      5   select 4 emp_type from dual union all
      6   select 5 emp_type from dual
      7  )
      8  --- actual query starts here
      9  select (case
    10          when emp_type between 1 and 3 then '01'
    11          when emp_type between 2 and 4 then '04'
    12          when emp_type between 4 and 5 then '05'
    13          end )
    14  from emp       
    15  ;
    (C
    01
    01
    01
    04
    05
    5 rijen zijn geselecteerd.
    MHO%xe> with emp as
      2  (select 1 emp_type from dual union all
      3   select 2 emp_type from dual union all
      4   select 3 emp_type from dual union all
      5   select 4 emp_type from dual union all
      6   select 5 emp_type from dual
      7  )
      8  --- actual query starts here
      9  select (case emp_type  -->> Gives Error
    10          when emp_type between 1 and 3 then '01'
    11          when emp_type between 2 and 4 then '04'
    12          when emp_type between 4 and 5 then '05'
    13          end )
    14  from emp;
            when emp_type between 1 and 3 then '01'
    FOUT in regel 10:
    .ORA-00905: missing keywordhttp://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions004.htm#sthref2637
    PL/SQL
    MHO%xe> begin
      2  for rec in
      3  (
      4  with emp as (select 1 emp_type from dual union all
      5               select 2 emp_type from dual union all
      6               select 3 emp_type from dual union all
      7               select 4 emp_type from dual union all
      8               select 5 emp_type from dual
      9              )
    10             --- actual query starts here
    11             select *
    12             from   emp       
    13  )
    14  loop
    15     case
    16     when rec.emp_type between 1 and 3 then dbms_output.put_line('01');
    17     when rec.emp_type between 2 and 4 then dbms_output.put_line('04');
    18     when rec.emp_type between 4 and 5 then dbms_output.put_line('05');
    19     end case;
    20  end loop;
    21  end;
    22  /
    01
    01
    01
    04
    05
    PL/SQL-procedure is geslaagd.http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/case_statement.htm#LNPLS01304
    Edited by: hoek on May 17, 2009 3:34 PM adds doc links

  • Assignment of transaction attributes in ejb-jar.xml

    Hi all,
    I'm going through the employee example from the book "Java programming in SAP web application server". I have followed the instrucstions to the letter and have triple checked that i did not miss anything.
    During the part "Defining Transaction Control", when i go to the "Assembly" tab, choose "Container-transaction" and click add; i get the following error message.
    You have to create and reference EJBs first. Afterwards you can choose them here.
    Newly created EJBs are referenced automatically in the ejb-jar.xml, in special cases you might have to reference them manually.
    Below is a copy of the ejb-jar. Both beans are referenced in the file so i don't really understand the error message!
    Thanks for your help.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
         <description>EJB JAR description</description>
         <display-name>EJB JAR</display-name>
         <enterprise-beans>
              <session>
                   <ejb-name>EmployeeServicesBean</ejb-name>
                   <home>com.sap.demo.EmployeeServicesHome</home>
                   <remote>com.sap.demo.EmployeeServices</remote>
                   <local-home>com.sap.demo.EmployeeServicesLocalHome</local-home>
                   <local>com.sap.demo.EmployeeServicesLocal</local>
                   <ejb-class>com.sap.demo.EmployeeServicesBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/Employee</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <local-home>com.sap.demo.EmployeeLocalHome</local-home>
                        <local>com.sap.demo.EmployeeLocal</local>
                        <ejb-link>EmployeeEjb.jar#EmployeeBean</ejb-link>
                   </ejb-local-ref>
              </session>
              <entity>
                   <ejb-name>EmployeeBean</ejb-name>
                   <home>com.sap.demo.EmployeeHome</home>
                   <remote>com.sap.demo.Employee</remote>
                   <local-home>com.sap.demo.EmployeeLocalHome</local-home>
                   <local>com.sap.demo.EmployeeLocal</local>
                   <ejb-class>com.sap.demo.EmployeeBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Long</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>EmployeeBean</abstract-schema-name>
                   <cmp-field>
                        <field-name>lastname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>firstname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <field-name>department</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
                   <query>
                        <description>Query for getting all employee objects.</description>
                        <query-method>
                             <method-name>findAllEmployees</method-name>
                             <method-params/>
                        </query-method>
                        <ejb-ql>Select object (p) from EmployeeBean p</ejb-ql>
                   </query>
              </entity>
         </enterprise-beans>
         <assembly-descriptor/>
    </ejb-jar>

    I was able to add the transaction attributes manually to the ejb-jar.xml file. below is what the file looks like now for those interested.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
         <description>EJB JAR description</description>
         <display-name>EJB JAR</display-name>
         <enterprise-beans>
              <session>
                   <ejb-name>EmployeeServicesBean</ejb-name>
                   <home>com.sap.demo.EmployeeServicesHome</home>
                   <remote>com.sap.demo.EmployeeServices</remote>
                   <local-home>com.sap.demo.EmployeeServicesLocalHome</local-home>
                   <local>com.sap.demo.EmployeeServicesLocal</local>
                   <ejb-class>com.sap.demo.EmployeeServicesBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <ejb-local-ref>
                        <ejb-ref-name>ejb/Employee</ejb-ref-name>
                        <ejb-ref-type>Entity</ejb-ref-type>
                        <local-home>com.sap.demo.EmployeeLocalHome</local-home>
                        <local>com.sap.demo.EmployeeLocal</local>
                        <ejb-link>EmployeeEjb.jar#EmployeeBean</ejb-link>
                   </ejb-local-ref>
              </session>
              <entity>
                   <ejb-name>EmployeeBean</ejb-name>
                   <home>com.sap.demo.EmployeeHome</home>
                   <remote>com.sap.demo.Employee</remote>
                   <local-home>com.sap.demo.EmployeeLocalHome</local-home>
                   <local>com.sap.demo.EmployeeLocal</local>
                   <ejb-class>com.sap.demo.EmployeeBean</ejb-class>
                   <persistence-type>Container</persistence-type>
                   <prim-key-class>java.lang.Long</prim-key-class>
                   <reentrant>False</reentrant>
                   <cmp-version>2.x</cmp-version>
                   <abstract-schema-name>EmployeeBean</abstract-schema-name>
                   <cmp-field>
                        <description>
                        </description>
                        <field-name>lastname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <description>
                        </description>
                        <field-name>firstname</field-name>
                   </cmp-field>
                   <cmp-field>
                        <description>
                        </description>
                        <field-name>id</field-name>
                   </cmp-field>
                   <cmp-field>
                        <description>
                        </description>
                        <field-name>department</field-name>
                   </cmp-field>
                   <primkey-field>id</primkey-field>
                   <query>
                        <description>Query to get all employee objects.</description>
                        <query-method>
                             <method-name>findAllEmployees</method-name>
                             <method-params/>
                        </query-method>
                        <ejb-ql>Select object (p) from EmployeeBean p</ejb-ql>
                   </query>
              </entity>
         </enterprise-beans>
         <assembly-descriptor>
              <container-transaction>
                   <description>container-transaction</description>
                   <method>
                        <ejb-name>EmployeeBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <method>
                        <ejb-name>EmployeeServicesBean</ejb-name>
                        <method-name>*</method-name>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    Thanks

  • Starting SAP transaction in between ABAP code

    Hi,
    How can I start a particular transaction in between ABAP code if certain condition is true.
    Regards,
    Tushar.

    If a program has a transaction code, there are two ways of starting it from another program.
    If you do not want to return to the calling program at the end of the new transaction, use the statement:
    LEAVE TO TRANSACTION <tcod> [AND SKIP FIRST SCREEN].
    This statement ends the calling program and starts transaction <tcod>. This deletes the call stack (internal sessions) of all previous programs. At the end of the transaction, the system returns to the area menu from which the original program in the call stack was started.
    If, on the other hand, you do not want to return to the calling program at the end of the new transaction, use the statement:
    CALL TRANSACTION <tcod> [AND SKIP FIRST SCREEN] [USING <itab>].
    This statement saves the data of the calling program, and starts transaction <tcod>. At the end of the transaction, the system returns to the statement following the call in the calling report. If the LEAVE statement occurs within the called transaction, the transaction ends and control returns to the program in which the call occurred.
    You can use a variable to specify the transaction <tcod>. This allows you to call transactions statically as well as dynamically.
    The addition AND SKIP FIRST SCREEN allows you to prevent the initial screen of the new transaction from being displayed. The first screen to be displayed is then the specified Next screen in the screen attributes of the initial screen. If the first screen calls itself as the next screen, you cannot skip it.
    Furthermore, the AND SKIP FIRST SCREEN option works only if all mandatory fields on the initial screen of the new transaction are filled completely and correctly with input values from SPA/GPA parameters.
    The USING ITAB addition in the CALL TRANSACTION statement allows you to pass an internal table <itab> to the new transaction. <itab> has the form of a batch input table. For further information about batch input tables, refer to Importing Data With Batch Input.
    Cheers
    Nishanth

  • 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

Maybe you are looking for