Trans attribute

Hi,
I use CMT.
1. In my EJB method, I simply delete a record from the Oracle database using sql query.Which transaction attribute would be appropriate in this case?
I guess 'NotSupported' is appropriate as I don't have multiple sql queries to delete.
2. Also, in the same page, when I call a single select sql query from my EJB method, I can use 'NotSupported'.
3.When I have a simple insert / update sql query(only insert/update in one table), I can use 'NotSupported'.
4.When I have to insert / update multiple sql queries in my EJB method,other transaction attributes would be appropriate.
Please let me know whether the above are correct.
Thanks in advance,

Hi,
From my own experience the type of transaction attribute you choose does not depend on the number of performed operations, but on other components that expect that operation to succeed. If you don't care if your operations (inserts, updates and deletes) fail or not, then maybe you could do away with transaction processing altogether. On the other hand, if other components (EJBs) require your code to succeed, then use TX attribute of Mandatory (transaction must exist), and start your transaction somewhere else with TX attribute of Required. This way new transaction will be started, and your beans (components) will join it.
I would suggest downloading a copy of "Mastering EJBs" from this location (it's free):
http://www.theserverside.com/books/wiley/masteringEJB/index.tss
Read the chapter on Transactions - in my opinion this is the best book on the subject.
I hope this helps.
Mark

Similar Messages

  • trans-attribute in ejb-jar.xml

    Dear All,
    To improve performance of my EJB's, I wish to set trans-attribute as "Supports"
    for all my get methods and rest of the methods as "Required".
    Heres the snippet from my ejb-jar.xml which I'm using to achieve the same:
    ======== start ejb-jar.xml =========
    <container-transaction>
    <method>
    <ejb-name>com.test.beans.TestBean</ejb-name>
    <method-name>get*</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>com.test.beans.TestBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    ======== end ejb-jar.xml ===========
    My doubt is:
    - Is this the right way to achieve the same?
    - Is there any possibility that 1st container would set the trans-attribute for
    all methods start with get to "Supports" and then set the trans-attribute as "Required"
    for all method[since I've used * afterwards], i.e overwrite the changes for get*
    methods?
    - Or Should I do it other way around? i.e 1st set trans-aatribute of all methods[*]
    and then overwrite for get* methods?
    Comments plz !!!
    Thanx
    ~Puneet Maini

    "Puneet Maini" <[email protected]> wrote in message
    news:[email protected]..
    >
    Dear All,
    To improve performance of my EJB's, I wish to set trans-attribute as"Supports"
    for all my get methods and rest of the methods as "Required".
    Heres the snippet from my ejb-jar.xml which I'm using to achieve the same:
    ======== start ejb-jar.xml =========
    <container-transaction>
    <method>
    <ejb-name>com.test.beans.TestBean</ejb-name>
    <method-name>get*</method-name>
    </method>
    <trans-attribute>Supports</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>com.test.beans.TestBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    ======== end ejb-jar.xml ===========
    My doubt is:
    - Is this the right way to achieve the same?
    - Is there any possibility that 1st container would set thetrans-attribute for
    all methods start with get to "Supports" and then set the trans-attributeas "Required"
    for all method[since I've used * afterwards], i.e overwrite the changesfor get*
    methods?
    - Or Should I do it other way around? i.e 1st set trans-aatribute of allmethods[*]
    and then overwrite for get* methods?The order does not matter. You can specify the transaction settings in any
    order you want. Note that the "get*" is more specific than the "*" for the
    method-name element.
    Also with supports, if this bean is invoked in a transaction then the
    caller's transaction will whatever settings it has would take precedence.
    >
    Comments plz !!!
    Thanx
    ~Puneet Maini

  • Trans-attribute of Mandatory

    Hello,
    I am running WebLogic 6.1 on NT. Today I ran an experiment by setting trans-attribute
    to "Mandatory". The client calls this method with no transaction. The result
    is that the method is not executed and there is no error message anywhere. This
    seems to be a very tricky kind of error to catch.
    Once I changed the trans-attribute to "Requires" without changing anything
    else, the method was executed normally.
    Does any one have any comments on using "Mandatory"?
    Simon

    I can tell you what the EJB 2.0 Spec says:
    17.6.2.5 Mandatory
    The Container must invoke an enterprise Bean method whose transaction attribute is set to
    Mandatory in a client’s transaction context. The client is required to call with a transaction
    context.
    • If the client calls with a transaction context, the Container performs the same steps as
    described in the Required case.
    • If the client calls without a transaction context, the Container throws the
    javax.transaction. TransactionRequiredException exception if the client is a remote client, or
    the javax.ejb.TransactionRequiredLocalException if the client is a local client..
    Is that not what you are seeing?
    Bill
    Simon Ng wrote:
    Hello,
    I am running WebLogic 6.1 on NT. Today I ran an experiment by setting trans-attribute
    to "Mandatory". The client calls this method with no transaction. The result
    is that the method is not executed and there is no error message anywhere. This
    seems to be a very tricky kind of error to catch.
    Once I changed the trans-attribute to "Requires" without changing anything
    else, the method was executed normally.
    Does any one have any comments on using "Mandatory"?
    Simon

  • Using trans-attribute of Required with public vs. private bean methods

              I'm having problems attempting to begin my transaction (using the Required transaction attribute
              setting in the desployment descriptor) in a private stateless session bean method. The scenario is as follows:
              public void methodA() <-- want NO transactional setting
              doSomething();
              private void doSomething() <-- want trans-attribute of Required
              doFirstPart(); <-- trans-attribute of Supports
              doSecondPart(); <-- trans-attribute of Supports
              When I do this, if I force a failure in the doSecondPart() method, the doFirstPart() database activity is NOT
              rolled back properly. If I go ahead and set the trans-attribute of methodA() to Required and change
              doSomething() to Supports, then any database activity in doFirstPart() appropriately gets rolled back
              upon a failure in doSecondPart(). Can I not initiate a transaction in a private method? Can anyone point
              me in the right direction?
              Thanks!!
              - Jim
              

              Here is the deal. What I was missing was this...to take advantage of the transaction attribute settings that are set in the deployment descriptor, you must call a method that is present in the remote interface. AND you must call that method through its remote interface instead of calling it locally.
              For example, I originally had the scenario below:
              public void methodA()
              doSomething();
              private void doSomething()
              Well, in the code above, there are two problems.
              1) doSomething() needs to be public and part of the remote interface;
              2) methodA() needs to call the method using the remote interface instead of calling the method locally.
              Like this:
              public void methodA()
              Object ref = jndiContext.lookup("ejb-name");
              EJBObjectType obj = (EJBObjectType) PortableRemoteObject.narrow(ref, EJBObjectType.narrow);
              obj.doSomething();
              public void doSomething()
              Or something pretty close to that. Make sense? This means that there is NO effect of putting private methods with transaction attribute values in the deployment descriptor.
              "Jim Clingenpeel" <[email protected]> wrote:
              >
              >Yes, I am using a JTS connection.
              >
              >Another interesting point. I even attempted to make the doSomething() method public and part of
              >the remote interface but the transaction still did not work properly (i.e., database activity from the
              >doFirstPart() method was not rolled back upon failure of doSecondPart()) unless my client application
              >called the doSomething() method directly. If the client called methodA() which, in turn, calls
              >doSomething(), then the transaction did not behave properly.
              >
              >Any further thoughts?
              >
              >- Jim
              >
              >"Cameron Purdy" <[email protected]> wrote:
              >>Make sure that you are using the Tx driver, not just a pool.
              >>
              >>--
              >>
              >>Cameron Purdy
              >>[email protected]
              >>http://www.tangosol.com
              >>WebLogic Consulting Available
              >>
              >>
              >>"Jim Clingenpeel" <[email protected]> wrote in message
              >>news:[email protected]...
              >>>
              >>> I'm having problems attempting to begin my transaction (using the Required
              >>transaction attribute
              >>> setting in the desployment descriptor) in a private stateless session bean
              >>method. The scenario is as follows:
              >>>
              >>> public void methodA() <-- want NO transactional setting
              >>> {
              >>> doSomething();
              >>> }
              >>>
              >>> private void doSomething() <-- want trans-attribute of Required
              >>> {
              >>> doFirstPart(); <-- trans-attribute of Supports
              >>> doSecondPart(); <-- trans-attribute of Supports
              >>> }
              >>>
              >>> When I do this, if I force a failure in the doSecondPart() method, the
              >>doFirstPart() database activity is NOT
              >>> rolled back properly. If I go ahead and set the trans-attribute of
              >>methodA() to Required and change
              >>> doSomething() to Supports, then any database activity in doFirstPart()
              >>appropriately gets rolled back
              >>> upon a failure in doSecondPart(). Can I not initiate a transaction in a
              >>private method? Can anyone point
              >>> me in the right direction?
              >>>
              >>> Thanks!!
              >>>
              >>> - Jim
              >>
              >>
              >
              

  • Trans-attribute requiresNEw to commit the transaction

    hi guys,
    I am using DB2 8.1 version, IBM Websphere studio test env V5 and EJB1.1
    my ejb is stateless session bean which is a CMP
    I am calling an EJB method executeCommand(String sqlUpdateStatement) from another EJB in a loop to update a database table. when i did not set any <Trans-attribute> tag in ejb-jar.xml file, it was updating my database but when ever any exception occurrs, it rolls back my other successful transactions also which i dont want to. To avoid roll back i put this entry in my ejb-jar.xml
    ejb-jar.xml entry:
         <assembly-descriptor>
              <container-transaction>
                   <method>
                        <ejb-name>DataAccessManager</ejb-name>
                        <method-intf>Remote</method-intf>
                        <method-name>executeCommand</method-name>
                        <method-params>
                             <method-param>java.lang.String</method-param>
                        </method-params>
                   </method>
                   <trans-attribute>RequiresNew</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    now after putting this entry, the server execution stops at the statement.executeUpdate(sqlUpdateStatement) statement. and i get this exception:
    WTRN0066W: Transaction (69) 0001bba9:000000014514da536aa04a1b0717884432b37c35204068812f35[] has timed out after 120 seconds.
    [15/08/04 12:54:05:062 GMT+03:00] 5aee4703 ExceptionUtil E CNTR0019E: Non-application exception occurred while processing method "updateTransactionStatus". Exception data: com.ibm.websphere.csi.CSITransactionRolledbackException: Global tx rolled back
    at com.ibm.ejs.csi.TransactionControlImpl.getCurrentTransactionalUOW(TransactionControlImpl.java:635)
    at com.ibm.ejs.csi.TransactionControlImpl.preInvoke(TransactionControlImpl.java:340)
    at com.ibm.ejs.container.EJSContainer.preInvoke_internal(EJSContainer.java:2513)
    at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java:2277)
    at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java:2262)
    at com.zak.moi.ejb.db2.transaction.EJSRemoteStatelessLogger_bef34805.updateTransactionStatus(EJSRemoteStatelessLogger_bef34805.java:39)
    at com.zak.moi.ejb.db2.transaction._Logger_Stub.updateTransactionStatus(_Logger_Stub.java:390)
    at com.zak.moi.ejb.transaction.TransactionUpdateBean.changeTransactionStatus(TransactionUpdateBean.java:123)
    at com.zak.moi.ejb.transaction.TransactionUpdateBean.updateFailedTransactions(TransactionUpdateBean.java:142)
    at com.zak.moi.ejb.transaction.EJSRemoteStatelessTransactionUpdate_c1bce76b.updateFailedTransactions(EJSRemoteStatelessTransactionUpdate_c1bce76b.java:77)
    at com.zak.moi.ejb.transaction._TransactionUpdate_Stub.updateFailedTransactions(_TransactionUpdate_Stub.java:258)
    at com.zak.moi.web.transaction.ServiceGatewayServlet.doGet(ServiceGatewayServlet.java:42)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
    at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
    at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
    at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
    at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
    at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:923)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:528)
    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:176)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:201)
    at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
    at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
    at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
    at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
    at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:516)
    at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:362)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
    the snippet of code i m using is:
    <b>DataAccessManagerBean (which does the database stuff)</b>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         public boolean executeCommand(String sqlUpdateStmt)throws Exception{
              Connection connection = null;     
              Statement statement = null;                         
              connection = getConnection(dsJndiName);                              statement = connection.createStatement();
              int i = statement.executeUpdate(sqlUpdateStmt);     
              statement.close();
              connection.close();                         
              return true ;
         protected Connection getConnection(String dsJndiName){
              try {
                   DataSource datasource = getDataSource(dsJndiName);
                   if (datasource != null)
                        return datasource.getConnection();
              } catch (NamingException ne) {
                   return null;
              } catch (SQLException se) {
                   return null;
              return null;
         protected DataSource getDataSource(String dsJndiName)
         throws NamingException {
              DataSource dataSource = null ;
              InitialContext context = getInitialContext();
              dataSource = (DataSource) context.lookup(dsJndiName);
              return dataSource;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <b>LoggerBean (which calls the DataAccessManagerBean</b>
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         public boolean updateTransactionStatus(LoggerValueBean loggerValueBean){
              String updateSql = "UPDATE ADMINISTRATOR.TRANSACTION_LOGGER SET RECIEPT_ID="+loggerValueBean.getReceiptId()+",CICS_UPDATE_STATUS='"+
                                  getStatusVal(loggerValueBean.isCicsUdpateStatus())+"',CICS_UPDATE_RESULT='"+loggerValueBean.getCicsUpdateResult()+"',JDE_UPDATE_STATUS='"+
                                  getStatusVal(loggerValueBean.isJdeUpdateStatus())+"',JDE_UPDATE_RESULT='"+loggerValueBean.getJdeUpdateResult()+"',COLLECTOR_ID='"+          
                                  loggerValueBean.getCollectorId()+"',COLLECTOR_NAME='"+loggerValueBean.getCollectorName()+"',CUSTOMER_ID='"+
                                  loggerValueBean.getCustomerId()+"',CUSTOMER_NAME='"+loggerValueBean.getCustomerName()+"',TRANSACTION_TYPE='"+
                                  loggerValueBean.getTransactionType()+"',TERMINAL_ID='"+loggerValueBean.getTerminalId()+"',UPDATE_DATE='"+
                                  sdf.format(loggerValueBean.getTransactionDate())+"',TRANSACTION_STATUS="+loggerValueBean.getTransactionStatus()+
                                  //", PASSWORD = encrypt('"+loggerValueBean.getPassword()+"', '"+Constant.LOGGER_KEY_PASSWORD+"') "+
                                  ", AMOUNT="+loggerValueBean.getAmount()+ //AMOUNT INCLUDED 04042004
                                  " WHERE INVOICE_NO = "+loggerValueBean.getInvoiceNo();
              System.out.println(updateSql);
              try{     
                        DataAccessManager remote = getDataAccessManager();
                        boolean isUser = true;
                        if(loggerValueBean.getTransactionStatus() == Constant.SUCCESSFULL_TRANSACTION_STATUS_INT){
                             //if record is inserted successfully, delete the user record for security
                             String deleteUser = "DELETE FROM ADMINISTRATOR.USER WHERE RECIEPT_ID="+loggerValueBean.getReceiptId()+" AND INVOICE_NO="+loggerValueBean.getInvoiceNo();
                             System.out.println(deleteUser);
                             isUser = remote.executeCommand(deleteUser);
                        if(isUser){
                             return remote.executeCommand(updateSql);
                        else
                             return false;
              }catch(Exception ex){
                   System.out.println("____LoggerBean:updateTransactionStatus() : exception while updating failed transactions "+ex);
                   ex.printStackTrace();
                   return false;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    HELP ME GUYS!!!

    WTRN0066W: Transaction (69) 0001bba9:000000014514da536aa04a1b0717884432b37c35204068812f35[] has timed out after 120 seconds.The above suggests that there is a TIME OUT. Please debug your code such a way that there is no dead lock or racing condition. Alternatively you can get help from DBA to profile your queries and find out why this TIME OUT condition occurs.
    regards,
    Sekar

  • TimedObject -' TX attribute ' is not working with netbeans 5.0 and SAS 8.0

    Hello,
    I am building a master timer stateless session bean. I have followed the examples from this site as well as I know how, and have even removed all of the system messages and other fluff. I continue to get the following error:
    EJB Timeout method must have an attribute value of TX_REQUIRES_NEW OR TX_NOT_SUPPORTED for ejb
    I have looked through the TimedObject, Timer, and TimerHandle API, all of which seems very simple and does not have any TX field. The example from the site is also very simple, only requiring the declaration of a timer start, which needs a TimerHandle return(although the example does not have it returning a value, I have tried this code both as written and with a class level TimerHandle object returned from the createTimer(...).getHandle() method ), and the declaration of a void ejbTimeout(Timer timer). This method should work with no body in the method since the return is void. I also set my timer intervals to ensure that they were
    I am very confused and feel that this should be very easy. Does anyone know if I am dealing with a configuration error? I know that netbeans does not directly support the use of the ejb TimerService (which seems a little crazy to me, as most non-trivial applications require a timer in some form for periodic events), so are there any deployment descriptors in any of the files which need to be set for this service to work? This error looks to me like a configuration error on some level, or possibly a missing entry in one of the myriad of xml configuration files that are required. The code for my bean is below:
    package QualityPortal;
    import javax.ejb.*;
    * This is the bean class for the MasterSchedulerBean enterprise bean.
    * Created Jul 18, 2006 12:40:18 PM
    * @author ttaylor
    public class MasterSchedulerBean implements SessionBean, MasterSchedulerLocalBusiness, TimedObject
    private SessionContext context;
    private TimerHandle timerHandle = null;
    public void setSessionContext(SessionContext aContext)
    context = aContext;
    * @see javax.ejb.SessionBean#ejbActivate()
    public void ejbActivate()
    * @see javax.ejb.SessionBean#ejbPassivate()
    public void ejbPassivate()
    * @see javax.ejb.SessionBean#ejbRemove()
    public void ejbRemove()
    // </editor-fold>
    * See section 7.10.3 of the EJB 2.0 specification
    * See section 7.11.3 of the EJB 2.1 specification
    public void ejbCreate()
    timerHandle = startTimer();
    public javax.ejb.TimerHandle startTimer()
    TimerService timerService = context.getTimerService();
    Timer timer = timerService.createTimer(30000, "created timer");
    return timer.getHandle();
    public void ejbTimeout(Timer timer)
    //call to another bean here
    WMLReportFactoriesBean wml = new WMLReportFactoriesBean();
    wml.inspectionThroughput();
    }

    Your ejbTimeout() must have a transaction attribute, which resides in the ejb-jar.xml. You'd have to edit your descriptor to contain something like:
    <container-transaction>
    <method>
    <ejb-name>MasterScheduler</ejb-name>
    <method-name>ejbTimeout</method-name>
    </method>
    <trans-attribute>RequiresNew</trans-attribute>
    </container-transaction>
    Or NotSupported.
    Hope it helps.

  • Can I modify WLI system Bean's transaction attribute --turn on archiver resulting endless exception in log file

    hi,erveryone,
    one difficult question need help.
    Environment: WLS8.1sp2 + WLI8.1sp2 + ORACLE9i + solaris9
    when I started archiver manually,just for a while, wli system generated about 40,000 JMS messages in
    wli.internal.worklist.timer.queue,and consume the great mass of system resource of Database server,I had to stop these
    archive processes immediately to keep other applicaitons which using the same database running normal. I did so by
    following steps:
    (1) in WLI console, delete wli.internal.worklist.timer.queue;
    (2) in WLI console, reconstruct wli.internal.worklist.timer.queue;
    (3) restart wli server.
    after server was restarted, wli server output endless and repeatly exception to log file ,the typical exception was:
    ####<May 8, 2005 3:08:26 PM CST> <Info> <EJB> <app01> <jcwliserver> <ExecuteThread: '54' for queue:
    'weblogic.kernel.Default'> <<anonymous>> <BEA1-54B26B551CC1A8856F80> <BEA-010049> <EJB Exception in method: remove:
    java.sql.SQLException: Transaction rolled back: Unknown reason.
    java.sql.SQLException: Transaction rolled back: Unknown reason
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1299)
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
         at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
         at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_loadGroup0(ListenerBean_1nsp14__WebLogic_CMP_R
    DBMS.java:1055)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
    Logic_CMP_RDBMS.java:596)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
    Logic_CMP_RDBMS.java:584)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.ejbRemove(ListenerBean_1nsp14__WebLogic_CMP_RDBMS.j
    ava:2423)
         at weblogic.ejb20.manager.DBManager.remove(DBManager.java:1318)
         at weblogic.ejb20.internal.EntityEJBLocalHome.remove(EntityEJBLocalHome.java:214)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14_LocalHomeImpl.remove(ListenerBean_1nsp14_LocalHomeImpl.java:131)
         at
    com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean.removeTaskListeners(RemoteWorklistManagerBean.java:3001)
         at
    com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean_us8t1c_EOImpl.removeTaskListeners(RemoteWorklistManagerBean_us8t
    1c_EOImpl.java:698)
         at com.bea.wli.worklist.timer.WorklistTimerMDB.processListenerToRemove(WorklistTimerMDB.java:102)
         at com.bea.wli.worklist.timer.WorklistTimerMDB.onMessage(WorklistTimerMDB.java:61)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >
    ####<May 8, 2005 3:08:26 PM CST> <Info> <EJB> <app01> <jcwliserver> <ExecuteThread: '96' for queue:
    'weblogic.kernel.Default'> <<anonymous>> <BEA1-54B96B551CC1A8856F80> <BEA-010049> <EJB Exception in method: remove:
    javax.ejb.NoSuchEntityException: [EJB:010140]Bean with primary key: '153.22.52.28-17343c7.10243c3c6ec.a51' not found..
    javax.ejb.NoSuchEntityException: [EJB:010140]Bean with primary key: '153.22.52.28-17343c7.10243c3c6ec.a51' not found.
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_loadGroup0(ListenerBean_1nsp14__WebLogic_CMP_R
    DBMS.java:1165)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
    Logic_CMP_RDBMS.java:596)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.__WL_setTaskBean_listeners(ListenerBean_1nsp14__Web
    Logic_CMP_RDBMS.java:584)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14__WebLogic_CMP_RDBMS.ejbRemove(ListenerBean_1nsp14__WebLogic_CMP_RDBMS.j
    ava:2423)
         at weblogic.ejb20.manager.DBManager.remove(DBManager.java:1318)
         at weblogic.ejb20.internal.EntityEJBLocalHome.remove(EntityEJBLocalHome.java:214)
         at
    com.bea.wli.worklist.beans.entity.ListenerBean_1nsp14_LocalHomeImpl.remove(ListenerBean_1nsp14_LocalHomeImpl.java:131)
         at
    com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean.removeTaskListeners(RemoteWorklistManagerBean.java:3001)
         at
    com.bea.wli.worklist.beans.session.RemoteWorklistManagerBean_us8t1c_EOImpl.removeTaskListeners(RemoteWorklistManagerBean_us8t
    1c_EOImpl.java:698)
         at com.bea.wli.worklist.timer.WorklistTimerMDB.processListenerToRemove(WorklistTimerMDB.java:102)
         at com.bea.wli.worklist.timer.WorklistTimerMDB.onMessage(WorklistTimerMDB.java:61)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >
    The wli server generated log file very quickly ,:it can output 1M bytes log file per second,all logged information
    is similar to the <BEA-010049> excetpion metioned above. BEA support engineer suggested me to totally stop the
    archive ,I did so,but the server was still ouput the log file like crazy as before and the normal log information are
    completely override by <BEA-010049> excetpion.
    I checked the EntityEJBs in WLI console :Mywlidomain> Applications> WLI System EJBs> WLI Worklist Persistence$)A#,and
    found that in statistics table :
    ListenerBean : Pool miss ratio = 99.67%, transaction rollback ration = 99.90%,Destory Bean Ratio = 99.48%(see
    attachment)
    WorklistTimerMDB: transaction rollback ratio = 99.97%
    It seems ListenerBean worked incorrectly.I searched in support.bea.com and found one example which also about server
    output endless log file,the author solved this problem by changing Bean's transaction-attribute from 'Required'
    to 'RequiresNew' thought he didn't know why it works. I try this method by changing ListenerBean's
    transaction-attribute from 'Required' to 'RequiresNew'.
    $weblogic_home/integration/lib/wli-ejbs.ear/ejb-jar-generic.xml:
    <ejb-name>CommentBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>ListenerBean</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>RequiresNew</trans-attribute> -----------the default value is Required,I modified it to
    RequiresNew.
    </container-transaction>
    <container-transaction>
    really it works, the log file output resume normal. But there are still some problems:
    (1) this exception is still exist:
    javax.ejb.NoSuchEntityException: [EJB:010140]Bean with primary key: '153.22.52.28-17343c7.10243c3c6ec.a51' not found.
    (2) is this method safe ?(Does "Modify ListenBean's transaction-attribute" impat other parts of wli system?)
    (3) after changed the transaction attribute, if turn on archive again, the server output endless exception:
    ####<Jun 1, 2005 5:14:58 PM CST> <Info> <EJB> <app01> <jcwliserver> <ExecuteThread: '63' for queue:
    'weblogic.kernel.Default'> <<anonymous>> <BEA1-2F43890B86B0A8856F80> <BEA-010036> <Exception from ejbStore:
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start()
    failed on resource 'weblogic.jdbc.jta.DataSource': XAER_RMERR : A resource manager error has occured in the transaction
    branch
    oracle.jdbc.xa.OracleXAException
         at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1160)
         at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
         at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50)
         at weblogic.jdbc.jta.DataSource.start(DataSource.java:617)
         at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1075)
         at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1007)
         at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:218)
         at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1287)
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
         at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
         at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
         at
    com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.__WL_store(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:363
    6)
         at
    com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.ejbStore(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:3548)
         at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:745)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1142)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1868)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:250)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has occured in the transaction branch start()
    failed on resource 'weblogic.jdbc.jta.DataSource': XAER_RMERR : A resource manager error has occured in the transaction
    branch
    oracle.jdbc.xa.OracleXAException
         at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1160)
         at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
         at weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50)
         at weblogic.jdbc.jta.DataSource.start(DataSource.java:617)
         at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1075)
         at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1007)
         at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:218)
         at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1287)
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
         at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
         at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
         at
    com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.__WL_store(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:363
    6)
         at
    com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.ejbStore(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:3548)
         at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:745)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1142)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1868)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:250)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
         at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1292)
         at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
         at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:385)
         at weblogic.jdbc.jta.DataSource.connect(DataSource.java:343)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:305)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:2247)
         at
    com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.__WL_store(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:363
    6)
         at
    com.bea.wli.worklist.beans.entity.TaskBean_9fxazu__WebLogic_CMP_RDBMS.ejbStore(TaskBean_9fxazu__WebLogic_CMP_RDBMS.java:3548)
         at weblogic.ejb20.manager.DBManager.beforeCompletion(DBManager.java:927)
         at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:745)
         at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
         at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:115)
         at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1142)
         at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:1868)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:250)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:221)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:412)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:316)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:281)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2596)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2516)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    >
    How can I solve these problem ? any suggestion is warm welcome.
    Thanks in advance.
    Great Lou

    Back up all data to at least two different storage devices, if you haven't already done so. The backups can be made with Time Machine or with a mirroring tool such as Carbon Copy Cloner. Preferably both.
    Boot into Recovery (command-R at startup), launch Disk Utility, and erase the startup volume with the default options.This operation will destroy all data on the volume, so you had be better be sure of your backups. Quit Disk Utility and install OS X. When you reboot, you'll be prompted to go through the initial setup process. That’s when you transfer the data from one of your backups. For details of how this works, see here:
    Using Setup Assistant
    Transfer only "Users" and "Settings" – not "Applications" or "Other files." Don't transfer the Guest account, if it was enabled on the old system. Test. If the problem is still there, you have a hardware fault. Take the machine to an Apple Store for diagnosis.
    If the problem is resolved, reinstall your third-party software cautiously. Self-contained applications that install into the Applications folder by drag-and-drop or download from the App Store are safe. Anything that comes packaged as an installer or that prompts for an administrator password is suspect, and you must test thoroughly after reinstalling each such item to make sure you haven't restored the problem.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with proxy servers, or with networks that require a certificate for authentication.

  • 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

  • Error deploying EJB on weblogic: Unable to set the transaction attribute

    Hi,
    I'm trying to deploy an application in WL10.3.2 and an error occurred during activation of changes.
    Here is the error message from the log file:
    <Jun 6, 2011 1:28:27 PM MDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'serverEAR-2' due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
    Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
    Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
    weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
    Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
    Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.ejb.container.deployer.DeploymentDescriptorException: Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processCTs(MBeanDeploymentInfoImpl.java:1502)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processSpecificMethodCTs(MBeanDeploymentInfoImpl.java:1472)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeTransactionAttribute(MBeanDeploymentInfoImpl.java:773)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:259)
         at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1190)
         Truncated. see log file for complete stacktrace
    Please help me...Thanks.

    In your ejb-jar.xml you are referring to a method saveActionGroup(EditableActionGroup) which is not defined in your remote interface.
    Maybe you have made some typo in the configuration. Check your transaction section, i.e.,
    <container-transaction>
                <method>
                    <ejb-name>ViewBean</ejb-name>
                    <method-name>saveActionGroup</method-name>
                    <method-params>
                        <method-param>package.EditableActionGroup</method-param>
                    </method-params>
                </method>
                <trans-attribute>Required</trans-attribute>
    </container-transaction>or something similar. See if the defined methods are corresponding to the methods defined in the remote interface.

  • Transaction attributes and isolation not working as expected why ? !

    I have three beans participating in a TX
    SeatBean ---- entity (BMP)
    Res --------entity (BMP)
    AgentBean --- session (SFSB)
    AgentBean has bookSeat (seatNumber, amount) method that is being called by the client.
    The Agent bean bookSeat (seatNumber, amount) method locates the seat bean with the given seat number if the booked field is null (means the seat is open for booking)
    It sets the values for booking the seat (inserts a new record in Res table using ResBean and updates the Seat table using SeatBean )
    In the AgentBean I make a check if the booked filed is Y or null.
    If the field is Y it throws a RemoteException.
    I gave Tx attributes in the ejb-jar.xml for ALL the beans as follows
    In ejb-jar.xml <trans-attribute>Required</trans-attribute>
    In weblogic-ejb-jar.xml
    <transaction-isolation>
         <isolation-level>TRANSACTION_REPEATABLE_READ</isolation-level>
    I opened two windows as use1 and user2
    User1 makes search for a seat finds seat1 is not booked
    User2 makes search for a seat finds seat1 is not booked
    User1 books the seat
    User2 books the seat (user2 action is initiated immediately after user1 initiates the action)
    Use1 and user2 actions are successful. There are two records in Res table.
    The seat table reflects the last changes. i.e user2 action.
    My questions are
    1.user2 should not get any search result till user1 intiated TX is complete
    ( i.e user2 should got get any search result till user1 commits or roll back because TRANSACTION_REPEATABLE_READ )
    Why is that not happening?
    2.Since user1 books the seat for customer1 and sets booked = Y in seat table
    user should not be able to book the seat. but user2 actions are reflecting in DB.
    What is going wrong?
    Can any one explain?

    The following szenario will executed as follows:
    User1 makes search for a seat finds seat1 is not booked
    User2 makes search for a seat finds seat1 is not booked
    User1 books the seat
    User2 books the seat
    Use1 and user2 actions are successful. There are two records in Res table.1.) Agent Bean is a session bean with CMT:
    User1: | AgentBean.searchNotBookedSeats()
    Tx1 | call other EJBs with the same transaction
    | context (required)
    v <-- return
    **) at this point the transaction is finished, the
    isolation level is not used
    User2: | AgentBean.searchNotBookedSeats()
    Tx2 | call other EJBs with the same transaction
    | context (required)
    v <-- return
    User1: | AgentBean.bookSeat(...)
    Tx3 | Res.create(..) same transaction context
    v <-- return
    User2: | AgentBean.bookSeat(...)
    Tx4 | Res.create(..) same transaction context
    v <-- return
    In this case there are four transaction used. The easiest way to
    prevent that there exists more than one reservation for one seat is
    to use a database constraint. That's the way I would solve the
    problem.
    Here is another solution:
    2.) Agent Bean is a stateful session bean with BMT and the isolation
    attribute is higher or equal REPEATABLE_READ:
    User1: | AgentBean.searchNotBookedSeats()
    Tx1 | call other EJBs with the same transaction
    | context (required)
    v <-- return
    **) the method starts a transaction but does not
    finish it.
    User2: | AgentBean.searchNotBookedSeats()
    Tx2 | call other EJBs with the same transaction
    | context (required)
    v <-- return
    **) this method blocks until Tx1 will be finished
    User1: | AgentBean.bookSeat(...)
    Tx1 | Res.create(..) same transaction context
    v <-- return
    **) the method finish the transaction
    User2: | AgentBean.bookSeat(...)
    Tx2 | Res.create(..) same transaction context
    v <-- return
    In this case the isolation level will be used. The whole system is
    blocked for the time between searching and booking a seat.
    Thats not very good :-(
    Best Regards and mery christmas
    Markus

  • Filter and Sort Transient Attribute from Query Panel

    Jdev 11.1.1.3
    Hello,
    i am not able to filter a transient attribute from the standard query panel (with result table).
    I did following things:
    -Call an Initial AppMod Service Method from my Bounded Task Flow, and fill the Transient Attribute with some values (with setter method)
    -Next, call the Page with following characteristics:
    I defined a custom View Criteria with particular Bind Variables, take as query execution mode = In Memory and activate the Auto Query Flag
    Drag and Droped this Criteria from Conroll Panel on the Page as Query Panel with Table
    In Page Data Binding Definition, i set the InitialQueryOverridden Flag to true, otherwise no data will be filled in the transient attribute
    The sort and filter works only for the Database Attributes.
    Has anyone an Idea, how to keep same behavior for the trans attr.?
    Thank You!
    (Note: When i set the Query Mode (after init Call) to vo.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS), then the sorting of Trans Attr is working fine.
    But the filtering is not working well: Lets say a filtering is done by the Trans Attribute and we get 3 Rows. But when all rows wanted to be retrieved again, only those 3 are available then, no chance to get all rows back)

    Hi,
    assuming that sorting and filtering are similar, have a look here
    sorting on transient attribute
    Frank

  • Transaction attribute definition

    In the remote and home interface for a BMP entreprise bean, how and where I have to define transaction attributes for each method?

    Specify the <trans-attribute> element in ejb-jar.xml
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name></ejb-name>
    <method-name></method-name>
    </method>
    <trans-attribute></trans-attribute>
    </container-transaction>
    </assembly-descriptor>

  • Trans time out

    Hi,
    I have a stateless session bean which calls a class which parses a huge xml file
    and saves it to a database using entity bean, if the transaction runs for more
    than 5 minutes , Tx. timesout and the whole Tx. rolls back. In my stateless session
    bean i have timeout as 300 secs. In my enity bean trans attribute is mandatory.
    One way to handle this problem is to increase the timeout. Is there any other
    way of solving it or am i doing something fundamentally wrong.
    Thanks in advance

    Hi,
    I can't figure out why i got the time out exception here. The bean only has one
    method. what it does is to read off the message, if there is one then return the
    message, otherwise return null. Actually nothing is transactional, but I like
    the mechanism to time out the call. Question is:
    1.Am I doing in the right way that have the ejb be transaction aware?
    2. How can I figure out what caused the ejb to take that long?
    3. In case of time out, it time out at the exact time that specified, so it will
    throw the exception at that time? Normally what it should be done in the time
    out? Do somethong in the bean or the client needs to catch the exception? what's
    a good way to do it?
    Thanks
    java.rmi.UnexpectedException: Unexpected exception in ResBean.getResponse():
    javax.transaction.RollbackException: Transaction TxC (5517625, xid = 1018856429251_65762,
    timeout = 0, txState = Rolledback, root = null has been rolled back.Reason: Transaction
    (TxC (5517625, xid = 1018856429251_65762, timeout = 240, txState = Marked Rollback,
    root = null) rolled back after 240 sec.
         at weblogic.jts.internal.CoordinatorImpl.throwRollbackException(CoordinatorImpl.java:726)
         at weblogic.jts.internal.CoordinatorImpl.commit(CoordinatorImpl.java:347)
         at weblogic.jts.internal.TxContext.commit(TxContext.java:255)
         at weblogic.ejb.internal.StatelessEJBObject.postInvokeOurTx(StatelessEJBObject.java:88)
         at weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:758)
         at ResponseBeanEOImpl.getResponse(ResponseBeanEOImpl.java:105)
         at ResponseBeanEOImpl_ServiceStub.getResponse(ResponseBeanEOImpl_ServiceStub.java:145)
         at jsp_servlet._reponse._jspService(_response.java:150)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:106)
         at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:907)
         at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:851)
         at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:252)
         at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:364)
         at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:252)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Rob Woollen <[email protected]> wrote:
    What do you expect to happen when the tx rolls back? The timer service
    is not
    participating in the tx so you will not be called back again.
    There is a JMS "birth" time feature in WLS 6.1 JMS that you may want
    to look into.
    -- Rob
    subra36024 wrote:
    Hi rob,
    Thanks for your reply.
    After parsing the file i have to save the data to database. I amusing BMP for
    this. I want this to be the part of Tx. How do i handle this.
    Also The stateless session bean is triggered by a weblogic time services,
    Thanks
    Rob Woollen <[email protected]> wrote:
    I'd probably make the session bean's parse method NotSupported and
    not
    do the parse in
    the transaction.
    I also wonder if you should do this synchronously. i.e. is it necessary
    for the
    caller to wait 5+ minutes for the parse to complete. I'd considerusing
    messaging to
    publish the XML message and have it parsed by a consumer.
    -- Rob
    subra36024 wrote:
    Hi,
    I have a stateless session bean which calls a class which parses
    a
    huge xml file
    and saves it to a database using entity bean, if the transaction
    runs
    for more
    than 5 minutes , Tx. timesout and the whole Tx. rolls back. In
    my
    stateless session
    bean i have timeout as 300 secs. In my enity bean trans attribute
    is
    mandatory.
    One way to handle this problem is to increase the timeout. Is thereany other
    way of solving it or am i doing something fundamentally wrong.
    Thanks in advance

  • Error while deploying a message driven bean

    I am deployeing a MDB which is done successfully but the message is not retrieved(No message in teh queue). The following description is given in the log file.
    #1.5#0016E6197593004B0000000B000013040004288DE20D6CD8#1170489754872#com.sap.security.core.policy.PolicyInfoManagerImpl##com.sap.security.core.policy.PolicyInfoManagerImpl.copyApplicationConfiguration#Administrator#523####e5dbec01b35c11db90e70016e6197593#SAPEngine_Application_Thread[impl:3]_39##0#0#Error#1#/System/Security/WS/SecurityProtocol#Java###An error occured while copying configurations for application . Reason: #3#sap.com/MessageEAR#com.sap.engine.frame.core.configuration.NameNotFoundException#A configuration with the path "webservices/services/sap.com/MessageEAR" does not exist.#
    Can you please tell where to look for it and what to do?

    the session bean is ::
    public class SenderBean implements SessionBean {
      public static final boolean DEBUG = false;
      private SessionContext ctx;
      private TopicConnectionFactory factory;
      private TopicConnection connection;
      private Topic topic;
      public SenderBean() {
         log("constructor");
      public void ejbCreateSender() throws CreateException {
         log("ejbCreate");
                try {
                   InitialContext naming = new InitialContext();
                   factory = (TopicConnectionFactory)naming.lookup("jmsfactory/default/ExceptionTopicFactory");
                   topic = (Topic)naming.lookup("jmstopics/default/ExceptionTopic");
                   log("factory: " + factory);
                   allocateResources();
                } catch (Exception exc) {
                   log("exception occured during ejbCreate().");
                   throw new CreateException("Unexpected exception in ejbCreate().");
      public void ejbCreate() throws CreateException {
      public void ejbActivate() {
         log("ejbActivate");
         try {
           allocateResources();
         } catch (Exception exc) {
           exc.printStackTrace();
      public void ejbPassivate() {
         log("ejbPassivate");
         try {
           releaseResources();
         } catch (Exception exc) {
           exc.printStackTrace();
      public void ejbRemove() {
         log("ejbRemove");
      public void setSessionContext(SessionContext _ctx) {
         log("setSessionContext");
         ctx = _ctx;
      public void sendMessage(String text) throws MessageNotSentException {
         log("sendMessage");
         log("text = " + text);
         TopicSession session = null;
         try {
           session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
           log("topic = " + topic);
           TopicPublisher publisher = session.createPublisher(topic);
           TextMessage textMessage = session.createTextMessage();
           textMessage.setText(text);
           publisher.publish(textMessage);
           System.out.println("Message Sent");
           log("message sent");
         } catch (JMSException jmse) {
           jmse.printStackTrace();
           throw new MessageNotSentException(jmse.toString());
         } finally {
           try {
              if (session != null) {
                session.close();
           } catch (Exception exc) {
      private void releaseResources() throws JMSException {
         connection.close();
         connection = null;
      private void allocateResources() throws JMSException {
         connection = factory.createTopicConnection();
         log("connection = " + connection);
         connection.start();
         log("connection started");
      private void log(String message) {
         if (DEBUG) {
           System.out.println("SenderBean: " + message);
    the mdb is::
    public class MessageDisplayBean implements MessageDrivenBean, MessageListener {
           public static final boolean DEBUG = false;
           private MessageDrivenContext ctx;
           private QueueConnectionFactory factory;
           private QueueConnection connection;
           private Queue queue;
           public MessageDisplayBean() {
              System.out.println("In constructor");
              log("constructor");
           public void onMessage(Message message) {
              TextMessage textMessage = (TextMessage)message;
              try {
                String text = textMessage.getText();
                log("message received. Text follows:\n\n  " + text + "\n\n");
                connection = factory.createQueueConnection();
                connection.start();
                QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
                TextMessage confirmation = session.createTextMessage();
                confirmation.setText("Message \""+ textMessage.getText() + "\" received.");
                //queue = session.createQueue("ConfirmationQueue");
                QueueSender sender = session.createSender(queue);
                sender.send(confirmation);
                session.close();
                connection.close();
                System.out.println("Message received");
              } catch (javax.jms.JMSException jmse) {
           public void ejbRemove() {
              log("ejbRemove()");
           public void setMessageDrivenContext(MessageDrivenContext _ctx) {
              log("setMessageDrivenContext()");
              ctx = _ctx;
              System.out.println("In context");
           public void ejbCreate() {
              try {
                   System.out.println("In ejbcreate");
                InitialContext naming = new InitialContext();
                factory = (QueueConnectionFactory)naming.lookup("jmsfactory/default/ExceptionQueueFactory");
                queue = (Queue)naming.lookup("jmsqueues/default/ExceptionQueue");
                log("factory: " + factory);
              } catch (Exception exc) {
                log("exception occured during ejbCreate().");
              log("ejbCreate()");
           private void log(String str) {
              if (DEBUG) {
                System.out.println("MessageDisplayBean: " + str);
    th ejb-j2ee-engine.xml is::
    <ejb-j2ee-engine>
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>MessageDisplayBean</ejb-name>
                   <jndi-name>MessageDisplayBean</jndi-name>
                   <message-props>
                        <destination-name>ExceptionTopic</destination-name>
                        <connection-factory-name>ExceptionTopicFactory</connection-factory-name>
                   </message-props>
              </enterprise-bean>
              <enterprise-bean>
                   <ejb-name>MessageSender</ejb-name>
                   <jndi-name>MessageSender</jndi-name>
                   <session-props/>
              </enterprise-bean>
                   </enterprise-beans>
    </ejb-j2ee-engine>
    the ejb-jar.xml is::
                 <ejb-jar>
        <display-name>        Message Driver Bean Example      </display-name>
        <enterprise-beans>
            <session>
                <display-name>            MessageSender          </display-name>
                <ejb-name>MessageSender</ejb-name>
                <home>com.sap.message.sender.SenderHome</home>
                <remote>com.sap.message.sender.Sender</remote>
                <local-home>com.sap.message.sender.SenderLocalHome</local-home>
                <local>com.sap.message.sender.SenderLocal</local>
                <ejb-class>com.sap.message.sender.SenderBean</ejb-class>
                <session-type>Stateful</session-type>
                <transaction-type>Container</transaction-type>
                <ejb-local-ref>
                    <ejb-ref-name>ejb/SenderBean</ejb-ref-name>
                    <ejb-ref-type>Session</ejb-ref-type>
                    <local-home>com.sap.message.sender.SenderLocalHome</local-home>
                    <local>com.sap.message.sender.SenderLocal</local>
                    <ejb-link>MyEJB.jar#MessageSender</ejb-link>
                </ejb-local-ref>
                <resource-ref>
                    <res-ref-name>ExceptionTopicFactory</res-ref-name>
                    <res-type>javax.jms.TopicConnectionFactory</res-type>
                    <res-auth> Container</res-auth>
                </resource-ref>
                <resource-env-ref>
                    <resource-env-ref-name>ExceptionTopic        </resource-env-ref-name>
                    <resource-env-ref-type>   javax.jms.Topic        </resource-env-ref-type>
                </resource-env-ref>
            </session>
            <message-driven>
                <ejb-name>MessageDisplayBean</ejb-name>
                <ejb-class>com.sap.message.mdb.MessageDisplayBean</ejb-class>
                <transaction-type>Container</transaction-type>
                <message-driven-destination>
                    <destination-type>javax.jms.Topic</destination-type>
                </message-driven-destination>
                <resource-ref>
                    <res-ref-name>   ExceptionQueueFactory            </res-ref-name>
                    <res-type>              javax.jms.QueueConnectionFactory            </res-type>
                    <res-auth>              Container            </res-auth>
                </resource-ref>
                <resource-env-ref>
                    <resource-env-ref-name>        ExceptionQueue        </resource-env-ref-name>
                    <resource-env-ref-type>          javax.jms.Queue        </resource-env-ref-type>
                </resource-env-ref>
            </message-driven>
               </enterprise-beans>
        <assembly-descriptor>
            <container-transaction>
                <method>
                    <ejb-name>MessageDisplayBean</ejb-name>
                    <method-name>onMessage</method-name>
                </method>
                          <trans-attribute>           NotSupported         </trans-attribute>
            </container-transaction>
        </assembly-descriptor>
    </ejb-jar>

  • DS sends updates to DB only in commit (can't find modified data in same TX)

    Hello experts!
    We have a physical data service mapping a simple Oracle database table. When we update one record in the database (invoking submit on the DS), and use a function in that same dataservice to get the refreshed record, the updated column comes with the OLD value. But after the transaction ends (we isolated this is a simple JWS), the database gets updated.
    The most strange fact: we also did a test using another Data Service to do the update, now mapping a stored procedure to do the updates (without commits in body). Then the test works fine.
    The conclusion I can reach is DSP is holding the instance somewhere after the submit() and is not sending it to the database connection. I understand that the commit is not performed, but if I do a query in the same TX, I should see my changed, shouldn't I?
    We use WL 8.1.6 with DSP 2.5.
    We´d appreciate very much if yuo guys could help.
    Thanks,
    Zica.

    Let me get your scenario straight
    client starts a transaction
    client calls submit to update a data services
    client calls read to re-read the update value (does not see update)
    client ends the transaction
    If you read now, you will see the update
    And you're wondering why the first read doesn't seem the update values?
    By default, ALDSP 2.5 reads are through an EJB that has trans-attrib=NotSupported - which means if you do a read within a transaction, that transaction is suspended the call is made without any transaction, then the transaction is resumed. So this is one reason you don't see the read. To do the read via an EJB method with trans-attribute=Required. See TRANSACTION SUPPORT at http://e-docs.bea.com/aldsp/docs25/javadoc/com/bea/dsp/dsmediator/client/DataServiceFactory.html
    If you are using the control, the control will need to specify
    @jc:LiquidData ReadTransactionAttribute="Required"
    That is only part of the solution. You will also need to configure your connection pool with the property KeepXAConnTillTxComplete="true" to ensure that your read is on the same connection as your write.
    <JDBCConnectionPool CapacityIncrement="2"
    KeepXAConnTillTxComplete="true" />
    Then I have to ask - if your client already has the modified DataObject in memory, what's the purpose of re-reading it? If all you need is a clean ChangeSummary so you can do more changes (the ChangeSummary is not cleared when you call submit), you can simply call myDataObject..getDataGraph().getChangeSummary().beginLogging()

Maybe you are looking for