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

Similar Messages

  • SQL Server 2000 - Before Commiting the transaction.

    Hi All,
    I am using CF7 along with SQL Server 2000.
    And I am in a situation where I need to update some set of data to make sure that the changes are getting reflected in the front end.
    My approach is like, trying some update statements inside "Begin Tran" block.
    It goes like this,
    begin tran
    update table1 set field1='value' where cond='condition';
    And I am just refreshing my application (in the browser). But unusually it takes a bit time to load, and no records are being pulled out after that..
    My question is, do I need to perform a "Commit" to avoid this hanging kinda behaviour?.
    Any ideas?.

    I'm not sure I fully understand your issue, but I suspect that you will need to commit the transaction before that changes will be available to your web site.  If your changes are in one UPDATE statement a transaction isn't usually required since this is a single statement.  Database transactions are intended to group multiple SQL statements into a single block so that all changes will succeed or all will fail.
    Please post your CF and SQL code and the steps to re-create your issue.

  • 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

  • How to use the functionality of Simulation for the Transaction MIRO

    Hi Group,
    I have a requirement to call SAP from MS Excel and check for the SImulation option as under:
    The Excel will pass the values of Invoice Number, Posting date, PO number, PO Item number, Company code and etc., through the call of BAPI   -   'BAPI_INCOMINGINVOICE_CREATE'  in order to create Invoice in the SAP system.
    But the above BAPI is creating the Invoices in SAP system. Rather, I need to just check(thru SIMULATION) the records and come back to MS Excel with the MIRO numbers that will be created and the errror messages that will be returned back.
    In summary, I have to add two Buttons as:
       POST : this has to create MIRO(invoice Numbers) in the SAP System(populating the Success/Error Messages by calling
                   the above BAPI   -  This functionality is working fine now
       SIMULATE: this has to do  same functionality of "POST" option but should not create MIROs in the SAP system
                          Currently I am not able to achieve this as the above BAPI is creating MIROs in SAP.
    Kindly provide your inputs on how to go about incorporating the above SIMULATION functionality, by giving some simulation BAPIs that can be used for my functionality.
    Thanks for your help in advance.
    Regards,
    Vishnu.

    Hi Group,
    In continuation to my previous posting, I would like to give more inputs as under:
    when I was using the BAPI - BAPI_INCOMINGINVOICE_CREATE (unless I commit the transaction), MIRO would not be created in the system.
    Now, when I run the BAPI again with a different set of data, the Invoice Number is getting incremented by one.... this I dont need, if the Invoice is not committed and if I run the next time, I need to get the same Invoice Number....
    How can I achieve this task?
    Kindly let me know your inputs on this.
    Regards,
    Vishnu.

  • Can not commit distributed transaction

    Hi
    We get error "can not commit distributed transaction" during
    commit the transaction in which we have create NEW entities.
    Update-transactions on existing enitites work correct.
    Our problem is probably due to seauences for object IDs: we are using oracle native sequences:
    <sequence name="SeqErrRecObj" strategy="nontransactional" factory-class="native(Sequence=BUYING.SEQ_ERRRECOBJ)"/>
    As soon we use strategy="nontransactional" in managed environment,
    we get "can not commit distributed transaction" error by creating new instance.
    Switching to strategy="transactional" seems to eleminate this problem.
    I did not found any hint in about this in documentation.
    Can some one confirm our assumption that using nontransactional oracle sequences in manageg (WebLogic 9.2) environment
    is responsible for "can not commit distributed transaction" error and "strategy=transactional" is the right solution.
    Probably we are completely wrong and tehre is some other explanation for this error ?
    kind regards
    Andre Teshler

    Hi Andre,
    It sounds like you have not configured a non-transactional datasource. See section "4.2.1. Managed and XA DataSources" in the <kodo>/docs/jdo/pdf/manual.pdf. Connection is for the managed datasource and Connection2 for the non-transactional.
    David Ezzio

  • Removing the entity object commit from transaction handler

    Hi,
    The business reuirement of the OAFWK page developed by us is as explained below:
    The basic functionality is of updating the attributes of items attached to the change order.
    The UI components displayed in the page(Item attribute changes region) are built based on the properties of the item attributes as LOV,poplist,textbox etc..
    The dynamic VO mapped to these UI components is based on a standard entity object.
    User operation:Select any attribute group and click on Go button.The Item attributes of the attribute group are displayed.Enter values in the Item Attributes and click on Apply button of the region.(changes made in the attributes related to the attribute group are committed to the database using
    &lt;Root AM&gt;.getTransaction.commit()).
    Now we have two such regions in the same page.
    On top of the page the item attributes of _{color:#800000}&lt;Item Type X&gt;{color}_ are displayed.
    Down the page, the item attributes of {color:#0000ff}&lt;_Item Type Y_&gt;{color} are displayed.
    In few special cases i.e for few item attributes, on click of Apply button for {color:#0000ff}_Item Y_{color} , the attributes of {color:#800000}I_tem X_{color} are to be updated by calling a PLSQL API.When Apply button in the Item attributes of _{color:#0000ff}Item Type Y{color}_ is clicked,the execution of controllers is :
    1.Controllers of Item attribute changes region of {color:#800000}&lt;Item Type X&gt; {color}The dynamic VO is built for the item attributes of Item Type X
    2.Controllers of the Item attribute changes region of {color:#0000ff}Item Type Y{color} The dynamic VO is built for the item attributes of Item Type Y.In the last controller of the hierarchy, the PLSQL API call is included(by invoking the method in AM) to update few attribute values of {color:#800000}Item Type X and finally &lt;Root AM&gt;.getTransaction().commit().
    Problem : The updated values by PLSQL API for {color:#800000}_Item Type X_{color} are not reflected in the database but indeed the values entered by user for {color:#800000}_Item Type X_{color} in the top of the page are committed(The Apply button for {color:#800000}_Item Type X_{color} is not clicked).
    _&gt;&gt;Please note that the dynamic VOs of both the Item Types are built on the same standard Entity Object_
    I am struggling to know the reason why the values updated by PLSQL API are overwrittem by the values in the entity object even though the PLSQL API is called in the last controller of execution.Please let me know if there is any OAFWK constraint.
    I tried the approach of removing the commit of the dynamic VO built in the region of {color:#800000}_Item Type X&gt;_ {color}{color:#000000}I fetched the entity implementation of the dynamic VO row and used removeandRetain(),revert().But this approach failed.I am referring to the jdevdoc for the built-in methods.
    {color}
    Now the requirement is the latest values updated by API (for {color:#800000}_Item Type X_{color}) should be committed in the database but not the values updated by the entity object for {color:#800000}_Item Type X_ {color}{color:#000000}in the item attributes region{color}.
    There should a single commit for the entire transaction of the page.
    Is there any chance to remove the commit of item attributes of {color:#800000}_Item X_{color} alone from the transaction handler?There are few methods in oracle.jbo.server.EntityImpl class such as doRemoveFromTransactionManager().But these methods are either protected or private.So classes of other packages cannot access them.
    So pelase suggest me if there is a workaround for this scenario.
    Thanks and Regards,
    Kiran
    Edited by: Kiran.A on Sep 20, 2008 3:34 AM

    Hi Sumit,
    Yes I agree on that front that updating the same record through PLSQL and EO is not the right approach.
    But the business requirement is as such and we do not have any workaround for this.
    Please let me know if there is any way to avoid the EO commit by removing from transaction listener.
    Regards,
    Kiran

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

  • WLS 6.1 The transaction is no longer active...

    Hello guys,
    I have a litle problem. We have an application deployed on WLS 5.1. It is working perfect for more than an year now. We recently migrated to WLS 6.1, which went pretty painlessly. The only problem I figured out is a transaction timeout on one of our EJBs. It's a stateless one and does access a database. The database response time seems to exceed 30 secs and the container just rolls the transaction back and raises an exception:
    The transaction is no longer active (status = Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 31 seconds
    Name=[EJB com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate()],Xid=46:1c5c7ecedef996e9(6195252),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=31,seconds left=30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=started,assigned=none),SCInfo[npm2000+npm2000_1]=(state=active),properties=({weblogic.transaction.name=[EJB com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate()], weblogic.jdbc=t3://10.72.70.17:7201}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=npm2000_1+10.72.70.17:7201+npm2000+, Resources={})],CoordinatorURL=npm2000_1+10.72.70.17:7201+npm2000+)]). No further JDBC access is allowed  within this transaction.
    com.deuba.pricemodel.sessionbean.FXRateManagerEJB_9hbfr9_Impl populate rolled back. Reason: The transaction is no longer active (status = Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 31 seconds
    Name=[EJB com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate()],Xid=46:1c5c7ecedef996e9(6195252),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=31,seconds left=30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=started,assigned=none),SCInfo[npm2000+npm2000_1]=(state=active),properties=({weblogic.transaction.name=[EJB com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate()], weblogic.jdbc=t3://10.72.70.17:7201}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=npm2000_1+10.72.70.17:7201+npm2000+, Resources={})],CoordinatorURL=npm2000_1+10.72.70.17:7201+npm2000+)]). No further JDBC access is allowed  within this transaction.
    java.sql.SQLException: The transaction is no longer active (status = Marked rollback. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 31 secondsName=[EJB com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate()],Xid=46:1c5c7ecedef996e9(6195252),Status=Active,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=31,seconds left=30,activeThread=Thread[ExecuteThread: '9' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=started,assigned=none),SCInfo[npm2000+npm2000_1]=(state=active),properties=({weblogic.transaction.name=[EJB com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate()], weblogic.jdbc=t3://10.72.70.17:7201}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=npm2000_1+10.72.70.17:7201+npm2000+, Resources={})],CoordinatorURL=npm2000_1+10.72.70.17:7201+npm2000+)]). No further JDBC access is allowed  within this transaction.
            at weblogic.jdbc.jts.Connection.checkIfRolledBack(Connection.java:508)
            at weblogic.jdbc.jts.Statement.getResultSet(Statement.java:408)
            at weblogic.jdbc.rmi.internal.StatementImpl.getResultSet(StatementImpl.java:215)
            at weblogic.jdbc.rmi.SerialStatement.getResultSet(SerialStatement.java:322)
            at com.deuba.pricemodel.pool.FXRatePool.populate(Unknown Source)
            at com.deuba.pricemodel.sessionbean.FXRateManagerEJB.populate(Unknown Source)
            at com.deuba.pricemodel.sessionbean.FXRateManagerEJB_9hbfr9_EOImpl.populate(FXRateManagerEJB_9hbfr9_EOImpl.java:121)
            at jsp_servlet._system._qa.__fx_rate._jspService(__fx_rate.java:290)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
            at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)One problem could be, that the EJBs are compiled with the WLS 5.1 ejbc and also the deployment descriptors are 5.1 compliant. Does anyone have any clue?
    Tx in advance,
    Anton Maleev
    Software Engineer
    Frankfurt
    [email protected]

    Take a look at this link:
    http://e-docs.bea.com/wls/docs61////javadocs/weblogic/management/configuration/JTAMBean.html#getTimeoutSeconds()
    You'll notice the default transaction timeout in WLS 6.1 is 30 seconds. For container managed you
    can set this timeout in the trans-timeout-seconds attribute of the weblogic-ejb-xml.jar file.

  • 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

  • Rolling back the transaction from stateful session bean

    Hi,
    How can I mark the transaction to be rolled back in a stateful session bean implementation?.
    Should I call setRollbackOnly method or throw a RemoteException or throw an EJBException, etc.?
    the configuration is :
    OC4J 9.0.4
    Stateful session bean
    Related method has transaction attribute - "Required"
    thanks & regards.
    ps : I couldn't find a related topic even if this has been discussed before (too many topics). if so, excuses.
    Erdem.

    Tried using Bean managed transactions but with the same result. Given below is the sample code.
    UserTransaction uts = null;
    try {
    uts = (UserTransaction)(ctx.getUserTransaction());
    uts.begin();
    Connection con = null;
    con = getCountConnection();
    PreparedStatement ps = con.prepareStatement(sqlselectUserId);
    ps.executeUpdate();
    PreparedStatement ps1 = con.prepareStatement(sqlselectUserDetails);
    ps1.executeUpdate();
    uts.commit();
    catch(SQLException e) {
         uts.rollback();

  • Reading the changes with in the Transaction from Toplink

    Typically when we work on a transaction in a SQL Session ( say from SQL*Plus), the DML changes made with in that transaction are visible to the subsequent statements in the same transaction.
    How can we acheive the above functionality with a UnitOfWork? Using a query.ConformResultsInUnitOfWork helps, but only when the Toplink Cache is enabled. Can we achieve the same functionality in Toplink when the Toplink Cache is disabled.
    Many Thanks in advance for any information on this.

    Thanks for the update.
    Below is the sample code. It works fine when the Toplink Cache is enabled on the object. But when it is disabled the executeQuery below fires a query to the database and a null object is returned. I disable the cache at the descriptor level using the statements
    descriptor.alwaysRefreshCache();
    descriptor.disableCacheHits();
    myServerSession =(ServerSession) SessionManager.getManager().getSession("test100");
    myServerSession.login();
    myServerSession.initializeIdentityMaps();
    ClientSession clientSession = myServerSession.acquireClientSession();
    UnitOfWork unitOfWork = clientSession.acquireUnitOfWork();
    // transaction started
    unitOfWork.beginEarlyTransaction();
    Case t = new Case();
    t.setId("Case1");
    t.setClaimNumber("ClaimNo1");
    // object registered with uow, but not yet committed and not in the database
    unitOfWork.registerObject(t);
    Case t1 = new Case();
    t1.setId("Case1");
    //t1 = (Case)unitOfWork.readObject(t1);
    //get the same object using the conformResultsinUnitOfwork
    ReadObjectQuery roq = new ReadObjectQuery(t1.getClass());
    roq.conformResultsInUnitOfWork();
    roq.setSelectionCriteria(roq.getExpressionBuilder().get("id").equal("Case1"));
    t1 = (Case)unitOfWork.executeQuery(roq); //returns null
    //Update some attributes..
    t1.setClaimNumber("ClaimNo2");
    //Commit all changes
    unitOfWork.commit();
    The above sequence of statements works from a SQL prompt, but not from Toplink.

  • SQL0964C  The transaction log for the database is full

    Hi,
    i am planning to do QAS refresh from PRD system using Client export\import method. i have done export in PRD and the same has been moved to QAS then started imported.
    DB Size:160gb
    DB:DB2 9.7
    os: windows 2008.
    I facing SQL0964C  The transaction log for the database is full issue while client import and regarding this i have raised incident to SAP then they replied to increase some parameter like(LOGPRIMARY,LOGSECOND,LOGFILSIZ) temporarily and revert them back after the import. Based on that i have increased from as below mentioned calculation.
    the filesystem size of /db2/<SID>/log_dir should be greater than LOGFILSIZ*4*(Sum of LOGPRIMARY+LOGSECONDARY) KB
    From:
    Log file size (4KB)                         (LOGFILSIZ) = 60000
    Number of primary log files                (LOGPRIMARY) = 50
    Number of secondary log files               (LOGSECOND) = 100
    Total drive space required: 33GB
    To:
    Log file size (4KB)                         (LOGFILSIZ) = 70000
    Number of primary log files                (LOGPRIMARY) = 60
    Number of secondary log files               (LOGSECOND) = 120
    Total drive space required: 47GB
    But still facing the same issue. Please help me to resolve the ASAP.
    Last error TP log details:
    3 ETW674Xstart import of "R3TRTABUFAGLFLEX08" ...
    4 ETW000   1 entry from FAGLFLEX08 (210) deleted.
    4 ETW000   1 entry for FAGLFLEX08 inserted (210*).
    4 ETW675 end import of "R3TRTABUFAGLFLEX08".
    3 ETW674Xstart import of "R3TRTABUFAGLFLEXA" ...
    4 ETW000  [     dev trc,00000]  Fri Jun 27 02:20:21 2014                                             -774509399  65811.628079
    4 ETW000  [     dev trc,00000]  *** ERROR in DB6Execute[dbdb6.c, 4980] CON = 0 (BEGIN)                    85  65811.628164
    4 ETW000  [     dev trc,00000]  &+     DbSlModifyDB6( SQLExecute ): [IBM][CLI Driver][DB2/NT64] SQL0964C  The transaction log for the database is full. 
    4 ETW000                                                                                                  83  65811.628247
    4 ETW000  [     dev trc,00000]  &+     SQLSTATE=57011 row=1                                                                                             
    4 ETW000                                                                                                  51  65811.628298
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  67  65811.628365
    4 ETW000  [     dev trc,00000]  &+     DELETE FROM "FAGLFLEXA" WHERE "RCLNT" = ?                                                                        
    4 ETW000                                                                                                  62  65811.628427
    4 ETW000  [     dev trc,00000]  &+       cursor type=NO_HOLD, isolation=UR, cc_release=YES, optlevel=5, degree=1, op_type=8, reopt=0                    
    4 ETW000                                                                                                  58  65811.628485
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  53  65811.628538
    4 ETW000  [     dev trc,00000]  &+     Input SQLDA:                                                                                                     
    4 ETW000                                                                                                  52  65811.628590
    4 ETW000  [     dev trc,00000]  &+                        1 CT=WCHAR           T=VARCHAR         L=6     P=9     S=0   
    4 ETW000                                                                                                  49  65811.628639
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  50  65811.628689
    4 ETW000  [     dev trc,00000]  &+     Input data:                                                                                                      
    4 ETW000                                                                                                  49  65811.628738
    4 ETW000  [     dev trc,00000]  &+     row 1:             1 WCHAR           I=6       "210"               34  65811.628772
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  51  65811.628823
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  50  65811.628873
    4 ETW000  [     dev trc,00000]  *** ERROR in DB6Execute[dbdb6.c, 4980] (END)                              27  65811.628900
    4 ETW000  [    dbtran  ,00000]  ***LOG BY4=>sql error -964   performing DEL on table FAGLFLEXA                    
    4 ETW000                                                                                                3428  65811.632328
    4 ETW000  [    dbtran  ,00000]  ***LOG BY0=>SQL0964C  The transaction log for the database is full.  SQLSTATE=57011 row=1
    4 ETW000                                                                                                  46  65811.632374
    4 ETW000  [     dev trc,00000]  dbtran ERROR LOG (hdl_dbsl_error): DbSl 'DEL'                             59  65811.632433
    4 ETW000                         RSLT: {dbsl=99, tran=1}
    4 ETW000                         FHDR: {tab='FAGLFLEXA', fcode=194, mode=2, bpb=0, dbcnt=0, crsr=0,
    4 ETW000                                hold=0, keep=0, xfer=0, pkg=0, upto=0, init:b=0,
    4 ETW000                                init:p=0000000000000000, init:#=0, wa:p=0X00000000020290C0, wa:#=10000}
    4 ETW000  [     dev trc,00000]  dbtran ERROR LOG (hdl_dbsl_error): DbSl 'DEL'                            126  65811.632559
    4 ETW000                         STMT: {stmt:#=0, bndfld:#=1, prop=0, distinct=0,
    4 ETW000                                fld:#=0, alias:p=0000000000000000, fupd:#=0, tab:#=1, where:#=2,
    4 ETW000                                groupby:#=0, having:#=0, order:#=0, primary=0, hint:#=0}
    4 ETW000                         CRSR: {tab='', id=0, hold=0, prop=0, max.in@0=1, fae:blk=0,
    4 ETW000                                con:id=0, con:vndr=7, val=2,
    4 ETW000                                key:#=3, xfer=0, xin:#=0, row:#=0, upto=0, wa:p=0X00000001421A3000}
    2EETW125 SQL error "-964" during "-964" access: "SQL0964C  The transaction log for the database is full.  SQLSTATE=57011 row=1"
    4 ETW690 COMMIT "14208" "-1"
    4 ETW000  [     dev trc,00000]  *** ERROR in DB6Execute[dbdb6.c, 4980] CON = 0 (BEGIN)                 16208  65811.648767
    4 ETW000  [     dev trc,00000]  &+     DbSlModifyDB6( SQLExecute ): [IBM][CLI Driver][DB2/NT64] SQL0964C  The transaction log for the database is full. 
    4 ETW000                                                                                                  75  65811.648842
    4 ETW000  [     dev trc,00000]  &+     SQLSTATE=57011 row=1                                                                                             
    4 ETW000                                                                                                  52  65811.648894
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  51  65811.648945
    4 ETW000  [     dev trc,00000]  &+     INSERT INTO DDLOG (SYSTEMID, TIMESTAMP, NBLENGTH, NOTEBOOK) VALUES (  ? , CHAR(   CURRENT TIMESTAMP - CURRENT TIME
    4 ETW000                                                                                                  50  65811.648995
    4 ETW000  [     dev trc,00000]  &+     ZONE   ), ?, ? )                                                                                                 
    4 ETW000                                                                                                  49  65811.649044
    4 ETW000  [     dev trc,00000]  &+       cursor type=NO_HOLD, isolation=UR, cc_release=YES, optlevel=5, degree=1, op_type=15, reopt=0                   
    4 ETW000                                                                                                  55  65811.649099
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  49  65811.649148
    4 ETW000  [     dev trc,00000]  &+     Input SQLDA:                                                                                                     
    4 ETW000                                                                                                  50  65811.649198
    4 ETW000  [     dev trc,00000]  &+                        1 CT=WCHAR           T=VARCHAR         L=44    P=66    S=0   
    4 ETW000                                                                                                  47  65811.649245
    4 ETW000  [     dev trc,00000]  &+                        2 CT=SHORT           T=SMALLINT        L=2     P=2     S=0   
    4 ETW000                                                                                                  48  65811.649293
    4 ETW000  [     dev trc,00000]  &+                        3 CT=BINARY          T=VARBINARY       L=32000 P=32000 S=0   
    4 ETW000                                                                                                  47  65811.649340
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  50  65811.649390
    4 ETW000  [     dev trc,00000]  &+     Input data:                                                                                                      
    4 ETW000                                                                                                  49  65811.649439
    4 ETW000  [     dev trc,00000]  &+     row 1:             1 WCHAR           I=14      "R3trans"           32  65811.649471
    4 ETW000  [     dev trc,00000]  &+                        2 SHORT           I=2        12744              32  65811.649503
    4 ETW000  [     dev trc,00000]  &+                        3 BINARY          I=12744   00600306003200300030003900300033003300310031003300320036003400390000...
    4 ETW000                                                                                                  64  65811.649567
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  52  65811.649619
    4 ETW000  [     dev trc,00000]  &+                                                                                                                      
    4 ETW000                                                                                                  51  65811.649670
    4 ETW000  [     dev trc,00000]  *** ERROR in DB6Execute[dbdb6.c, 4980] (END)                              28  65811.649698
    4 ETW000  [    dbsyntsp,00000]  ***LOG BY4=>sql error -964   performing SEL on table DDLOG                36  65811.649734
    4 ETW000  [    dbsyntsp,00000]  ***LOG BY0=>SQL0964C  The transaction log for the database is full.  SQLSTATE=57011 row=1
    4 ETW000                                                                                                  46  65811.649780
    4 ETW000  [    dbsync  ,00000]  ***LOG BZY=>unexpected return code 2          calling ins_ddlog           37  65811.649817
    4 ETW000  [     dev trc,00000]  db_syflush (TRUE) failed                                                  26  65811.649843
    4 ETW000  [     dev trc,00000]  db_con_commit received error 1024 in before-commit action, returning 8
    4 ETW000                                                                                                  57  65811.649900
    4 ETW000  [    dbeh.c  ,00000]  *** ERROR => missing return code handler                               1974  65811.651874
    4 ETW000                         caller does not handle code 1024 from dblink#5[321]
    4 ETW000                         ==> calling sap_dext to abort transaction
    2EETW000 sap_dext called with msgnr "900":
    2EETW125 SQL error "-964" during "-964" access: "SQL0964C  The transaction log for the database is full.  SQLSTATE=57011 row=1"
    1 ETP154 MAIN IMPORT
    1 ETP110 end date and time   : "20140627022021"
    1 ETP111 exit code           : "12"
    1 ETP199 ######################################
    Regards,
    Rajesh

    Hi Babu,
    I believe you should have taken a restart of your system if log primary are changed.  If so, then increase log primary to 120 and secondary to 80 provide size and space are enough.
    Note 1293475 - DB6: Transaction Log Full
    Note 1308895 - DB6: File System for Transaction Log is Full
    Note: 495297 - DB6: Monitoring transaction log    
    Regards,
    Divyanshu

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

  • Question about implement the transaction in EJB

    Dear Sir
    I try to do some transaction work in EJB,I builded 6 bean blow
    OrderMgr(session bean) control Order(CMP Entity Bean)
    Istock(session bean) control Item(CMP Entity Bean)
    DeliveryMgr(session bean) control delivery(CMP Entity Bean)
    I try to implement the transaction in session bean OrderMgr Like
    public void submitOrder(int id) {
    Try
    Istock.dosomething
    Delivery.dosomething
    Bookorder.dosomething
    catch (Exception ex) {
    sessionContext.setRollbackOnly();
    But not Rollback not work
    Then I change Session Bean OrderMgr to BMT,write the code blow, but rollback still not work
    sessionContext getUserTransaction().beging();
    Try{
    Istock.dosomething
    Delivery.dosomething
    Bookorder.dosomething
    sessionContext.getUserTransaction().commit();
    catch (Exception ex) {
    sessionContext. rollback();
    Could anyone tellme what's wrong with me code?
    &#12288;&#12288;

    If you want to rollback work done by these methods, than you have to make sure that they don't start a new transaction. i.e. they should use tx attribute "required" or "mandatory".
    Istock.dosomething
    Delivery.dosomething
    Bookorder.dosomething

  • The server failed to resume the transaction. Desc:4500000006

    I am calling single store procedure from asp.net C# which basically insert/update data in two different tables. I am using SQL transaction in store procedure.
    I am getting exception
    THE SERVER FAILED TO RESUME THE TRANSACTION, DESC:4500000006. THE TRANSACTION ACTIVE IN THIS SESSION HAS BEEN COMMITTED OR ABORTED BY ANOTHER SESSION.
    Exception which I get its not frequent messsage.
    Any Idea!!!!
    ALTER PROCEDURE [dbo].[ssp_UpdateActivity]
    @ActivityID uniqueidentifier,
    @MasterCustomerID bigint = NULL,
    @MasterCustomerAccountNumber varchar(30) = NULL,
    @MasterIdentifier varchar(30) = NULL,
    @UpdateDateTime datetime,
    @UpdateBy varchar(100),
    @ActivitySDRecord dbo.ActivitySDRecord READONLY
    AS
    SET NOCOUNT ON;
    BEGIN TRY
    BEGIN TRAN
    UPDATE Activity
    SET MasterCustomerID = @MasterCustomerID,
    MasterCustomerAccountNumber = @MasterCustomerAccountNumber,
    MasterIdentifier = @MasterIdentifier,
    UpdateDateTime = @UpdateDateTime,
    UpdateBy = @UpdateBy
    WHERE ActivityID = @ActivityID
    IF EXISTS (SELECT * FROM @ActivitySDRecord)
    BEGIN
    MERGE ActivitySubDisposition AS TRG
    USING @ActivitySDRecord AS SRC
    ON TRG.ActivityID = SRC.ActivityID
    AND TRG.ActivityTypeID = SRC.ActivityTypeID
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (ActivityTypeID, ActivityID)
    VALUES (SRC.ActivityTypeID, SRC.ActivityID)
    END
    COMMIT TRAN
    SELECT @ActivityID
    END TRY
    BEGIN CATCH
    -- Rollback any uncommited transactions before rethrowing the error.
    IF XACT_STATE() <> 0
    BEGIN
    ROLLBACK TRANSACTION;
    END
    DECLARE @ErrorMessage NVARCHAR(4000)
    , @ErrorNumber INT = ERROR_NUMBER()
    , @ErrorSeverity INT = ERROR_SEVERITY()
    , @ErrorState INT = ERROR_STATE()
    , @ErrorLine INT = ERROR_LINE()
    , @ErrorProcedure NVARCHAR(200) = ISNULL(ERROR_PROCEDURE(), '-');
    -- Build the message string that will contain original error information.
    SET @ErrorMessage = N'Error %d, Level %d, State %d, Procedure %s, Line %d, ' + 'Message: '+ ERROR_MESSAGE();
    -- Raise an error: msg_str parameter of RAISERROR will contain the original error information.
    RAISERROR
    @ErrorMessage,
    @ErrorSeverity,
    1,
    @ErrorNumber, -- parameter: original error number.
    @ErrorSeverity, -- parameter: original error severity.
    @ErrorState, -- parameter: original error state.
    @ErrorProcedure, -- parameter: original error procedure name.
    @ErrorLine -- parameter: original error line number.
    END CATCH

    This appears to be an error message which has it roots in MS DTC, Microsoft Distributed Transaction Coordinator.
    This indicates that you somewhere manage to get a distributed transaction. This could be because of two things:
    1) There are triggers on the tables that accesses linked server.
    2) Your client code dabbles with some transaction class, like TransactionScope or similar.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for