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

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

  • 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

    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

  • 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

  • ADFBC EO attributes: "conditionally" mandatory

    We've a requirement via ADF BC to say that an EO attribute is mandatory/optional, based on an external piece of logic. In other words the field is "conditionally" mandatory, and polymorphic EOs are not suitable in this situation.
    I note in a previous OTN post: Re: Mandatory flag at  VO level.
    ...that ER 3176734 was raised to include such functionality, but I'm unsure if the ER was every implemented in ADF BC. Essentially is there an isAttributeMandatory() solution available somewhere in the 11g ADF BC framework, or at least some sort of solution that will give me the ability in code to determine is a field should be mandatory?
    Your help appreciated.
    CM.

    Yeah, Steve's 2a and 2b solution is what I came up with initially, which is "urg" as for every attribute you need to create a transient attribute, and I was hoping the ER had resulted in something useable/workable/scalable. We've discovered polymorphic EOs are limited in use where you have a predefined static list of discriminator values. In our case we can have an unlimited number of types, all with their own mandatory/optional attribute requirements, derived from a 3rd party rules engine. Of course it gets worse because we also have the need to change labels on the fly, as well as if the field is shown/hidden. A bunch of chokepoint methods similar to isAttributeUpdateable would have been ideal.
    Alternatively I've been investigating if you can do anything with the EntityDeflImpl class from the AttributeDefImpl point of view, but it seems to be mostly a read-only object which you can't override at runtime.
    Currently I'm thinking that what we'll need to do is create a JSF bean with a getter method based on a hashmap lookup, something like: #{smartBean.fieldMandatory.thisField}, where behind the scenes given the "thisField" hash, the isFieldMandatory method will use the hash to query the external business rule engine to discover if the field is mandatory/optional.... if that makes sense.
    CM.

  • Set up or flag the field of attribute as mandatory or optional

    Hi,
    I’d like to know if it’s possible to either set up or flag the attribute fields as either mandatory or optional. Is it possible with Java API?
    Thanks a lot.

    Hi Thomas,
    You have setting in the Console called Required that you can flag YES or NO to indicate whether the field is required or not.  However, this option setting does not actually enforce anything as of now.  In future releases of 2006, there is a proposal to enforce this.
    For now, the way I worked around is:
    1. I flag the field required YES in the console if I do NOT want NULL values in the field. (for the sake of setting).
    2. Then, in data manager I write validation expression using IS_NOT_NULL function on those fields so that manual entry does not allow NULL values.  It throws an error.
    3. Import Manager however cannot retrieve the validation expressions.  So, you can load null values in a field that has the expression written.  You will identify these if you manually run validation after the loads.
    4. <b>JAVA API</b> lets you enforce this when you are using API programs to post the data.  You can write such that if the consoel is set to YES, then do not let NULL values to post.
    I have some information around requried in fields in my blog:
    /people/savitri.sharma/blog/2005/09/22/tips-and-hints-for-new-mdm-users
    Is this helpful?
    Good luck
    Savi

  • 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

  • JTA & BPEL

    I'm having some problems managing transactions from a BPEL process. I've created a session bean that is used to invoke stored procedures in a SQL Server database. This session bean is accessed from BPEL via WSIF. We've tested this a bit and everything seems to work fine.
    Now, we are attempting to add error handling to our processes. My preference is to share the BPEL processes' context with the session bean so BPEL can manage the transactions.
    I've tested this approach outside of BPEL- I created a servlet that does something like this-
    Object o = new InitialContext().lookup("java:comp/UserTransaction");
    UserTransaction ut = (UserTransaction)o;
    ut.begin();
    //now get session bean and call sprocs
    ut.commit();
    From the servlet, this seems to work fine so long as the 'trans-attribute' of my session bean is 'Mandatory'. It seems to commit or rollback appropriately based on the method called on the user transaction.
    I'm trying to get it to work similarly from BPEL. When the trans-attribute is mandatory in the session bean I get 'javax.transaction.TransactionRequiredException: Transaction can not be null'. I've tried this both from embedding and from WSIF with the same result. When the trans-attribute is 'Required' the transactions are always committed, even when I throw a fault.
    Am I missing some setting in the BPEL process/domain for JTA? This is possible right?
    Thanks for the help,
    Mike

    I've defined my BPEL suitcase-
    <BPELSuitcase>
    <BPELProcess id="TestEFrequency" src="TestEFrequency.bpel">
    <partnerLinkBindings>
    <partnerLinkBinding name="client">
    <property name="wsdlLocation">TestEFrequency.wsdl</property>
    </partnerLinkBinding>
    <partnerLinkBinding name="eFrequencyConnector">
    <property name="wsdlLocation">eFrequencyConnector.wsdl</property>
    <property name="java.naming.security.principal">admin</property>
    <property name="java.naming.security.credentials">welcome</property>
    <property name="dedicated.connection">true</property>
    <property name="participate">true</property>
    </partnerLinkBinding>
    <partnerLinkBinding name="TestOracleDB">
    <property name="wsdlLocation">insertRecord.wsdl</property>
    <property name="retryInterval">60</property>
    <property name="participate">true</property>
    </partnerLinkBinding>
    </partnerLinkBindings>
    <configurations>
    <property name="transaction">participate</property>
    <property name="inMemoryOptimization">true</property>
    </configurations>
    </BPELProcess>
    </BPELSuitcase>
    The merge activity on the Oracle DB adapter is rolling back fine. However, the BPEL transaction context doesn't seem to be propogating to the session bean (eFrequencyConnector.wsdl).
    How would you propose a new transaction would work? If I begin a new transaction for my session bean methods, it would be a new context right?

  • Set attribute to be mandatory in set type

    Hi! Can I confirm whether it is possible to set certain attribute fields to be mandatory in a set type? The transaction code to create set attribute and assign to the set type is COMM_ATTRSET.
    Thanks!
    SF

    Hi SF,
    In the standard system, you cannot configure an attribute to be mandatory in a set .
    However, you can try using transaction SFAC in order to set an attribute as mandatory; I am not sure if this procedure will work for you, but is it good to take a look. Into this transaction, you cam define which fields are displayed/hidden/mandatory.
    Keep on mind that every time a set is create in transaction COMM_ATTRSET, a corresponding module pool SAPLZOM_<set type name> is created with Screen group 0100.
    I hope it helps.
    Kind Regards,
    Gabriel Santana

  • Mandatory attributes

    In toystore demo the code below is used to display "*" if an attribute is mandatory. How do I do that using ADF? Since I am not using: <jbo:Row datasource="ToyStore.Accounts" action="current" id="row">
    I don't have a reference to the row.
    <%
    StructureDef def = row.getStructureDef();
    %>
    <%if(def.lookupAttributeDef("Firstname").isMandatory()){%>
    <bean:message key="dataentryform.mandatory"/>
    <%}%>

    The binding has a property "mandatory" that you can refer to using EL.

  • How can I change an objectclass definition to make a mandatory attributeoptional ?

    I am using my own objectclasses. I want to change the definition of
    one of them so that an attribute that is mandatory becomes optional.
    I have tried modifying cn=schema with an LDAP client. Certain
    modifications are accepted (adding new attributes, for example)
    but my mandatory attribute remains mandatory. I get no error
    message.
    My directory is Novell eDirectory 8.7.3
    Thanks for any help
    Franois Beretti

    This may work:
    Atomic Operation
    On these operations it is necessary that the operation be performed
    within the same transaction. Modification of this type must be atomic or
    they will fail with an error of constraint violation.
    Further as schema entries are typically done on attributetypes or
    objectClasses which are essentially muti-valued attributes, it the
    "delete" operation must reference the value being modified EXACTLY what
    exist in the schema.
    As an example:
    Add Attribute to a ObjectClass
    Here is an example of a modification to a class that adds an attribute
    to the class:
    dn: cn=schema
    changetype: modify
    delete: objectclasses
    objectclasses: ( 2.16.840.1.113719.1.131.6.1.23 NAME 'myNewClass'
    SUP top MUST ( myNewAttrOne $ myNewAttrTwo ) MAY
    (myANewAttrThree $ myNewAttrFour $ myNewAttrFive ) )
    add: objectclasses
    objectclasses: ( 2.16.840.1.113719.1.131.6.1.23 NAME 'myNewClass'
    SUP top MUST ( myNewAttrOne $ myNewAttrTwo ) MAY (
    myNewAttrThree $ myNewAttrFour $ myNewAttrFive $
    myNewAttrSix ) )
    Limitations
    There are some limitations with making modifications to existing schema
    entries. These are based on referential integrity and follow common sense.
    Any schema modification that could possibly invalidate any data is not
    allowed. For example, in the first example above, the upper bound was
    changed from 8 to 40, thus increasing the range of possible values. The
    bound could not be modified to a value below 8, or it could invalidate
    data values.
    Similarly, an attribute could be changed from a single-valued attribute
    to a multivalued attribute, but not the reverse as there may be data
    with multiple values. You could change a class and make an object a
    container, but you cannot change a container object into a leaf object
    as the container may contain other objects.
    -jim
    Franois Beretti wrote:
    > I am using my own objectclasses. I want to change the definition of
    > one of them so that an attribute that is mandatory becomes optional.
    >
    > I have tried modifying cn=schema with an LDAP client. Certain
    > modifications are accepted (adding new attributes, for example)
    > but my mandatory attribute remains mandatory. I get no error
    > message.
    >
    > My directory is Novell eDirectory 8.7.3
    >
    > Thanks for any help
    >
    > Franois Beretti

  • Mandatory fields in a LOV

    I have a view in which I've added attributes from an entity to make a LOV. These attributes are mandatory in said entity. Foreign key in the view (and in an underlying entity) is not mandatory however (it can be null).
    When I drop this LOV column onto a page as an InputText with ListOfValues, resulting form field is required (and it will show an error if I leave it empty and try to submit the form). That is not what I expect. The entity referenced from a view is not updatable, the underlying entity is.
    How can I have an optional field with a LOV, not making referenced entity columns non-mandatory?

    Hi,
    Try after remove required attribute in your LOV
    required="#{bindings.YourField.hints.mandatory}"

  • OIM 11g R2 - Setting a field as mandatory while provisioning through catalo

    Hi,
    May I know how i can make a field as mandatory (Red Asterick) while trying to provision an account through catalog wizard.I dont see any option to set required=true while creating a form for an application instance.Thanks.

    login to sysadmin-> create sandbox-> go to form designer->select your form now click on customize link(right top corner)->select your attribute and set the required field as true and then save it. finally export sandbox. run catalog sync job. and then verify if attribute is mandatory in the request form/dataset or not.
    same mentioned in R2 release note

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

Maybe you are looking for

  • Calling application from other database

    It's possible to call an application on another database, without informing user and password again?

  • DMS link with content server

    Hi All, Plz let me know that how the DIR is getting path of content server where it needs to get saved. Means i want to know that where we have to put the path of Content server into the system(SPRO) .I found some place to put the same in "Define Dat

  • EJB +FLAT FILE READ options

    Hi Form I know it's really Against the policy to read a FLAT File in EJB env, But On a classic scenireio , When one has to use a 3rd party tool with Flat file Read / Write complications arise How dos one Cope with this manner With regards Karthik

  • CMS Configuration Problem

    Hi Folks, While configuring NWDI - CMS, under Transport Studio, we need to put SAP-JEE.sca, SAP_BUILDT.sca and SAP_JTECHS.sca files under \usr\sap\JTrans\CMS\inbox. so that these files can be seen in Checked-In tab. Usually these files can be found u

  • Access to apple care

    I have apple care.  I am working overseas and when I type in my phone number it says it is not a valid number.  I can't find an email address.  How do I get support?