[jira] Commented: (SANDESHA2-179) Adding correct message numbers with jdbc storage

"Andrew Gatford (JIRA)" <[email protected]> Mon, 5 Jan 2009 00:03:45 -0800 (PST)
Newsgroups gmane.comp.apache.webservices.fx.devel
Message-ID <1587214349.1231142625873.JavaMail.jira@brutus>
    [ https://issues.apache.org/jira/browse/SANDESHA2-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12660677#action_12660677 ] 

Andrew Gatford commented on SANDESHA2-179:
------------------------------------------

We can't apply this patch to Sandesha2 as it will have terrible performance impacts.  This patch will near enough make it single threaded through the Sandesha2 core.  Secondly - this doesn't work in a distributed environment where multiple JVMs could be using the same RMS/RMD beans.
The correct fix is to use the Database itself as the locking mechanism.  This means changing the isolation level on the database (I think) so that if there is a write in progress, no other transactions can get the rmsBean/rmdBeans.  All other implementations (that I know of and I do count my own implementation in this) lock the rmsBean inside the storage manager itself (look at InMemoryTransaction and the InMemoryRMSBeanMgr)

> Adding correct message numbers with jdbc storage 
> -------------------------------------------------
>
>                 Key: SANDESHA2-179
>                 URL: https://issues.apache.org/jira/browse/SANDESHA2-179
>             Project: Sandesha2
>          Issue Type: Bug
>            Reporter: Amila Chinthaka Suriarachchi
>         Attachments: core_patch.txt, patch.txt, patch.txt, persistence_patch.txt
>
>
> I ran a 100 message message sequence  using the jdbc storage. The message receiver looks like this,
> protected void invokeBusinessLogic(MessageContext messageContext)
>             throws AxisFault {
>         System.out.println("Got the soap message ==> " + messageContext.getEnvelope().getBody().getFirstElement());
>     }
> and the client has this code to produce 100 messages.
> for (int i = 1; i < 100; i++) {
>         serviceClient.fireAndForget(getTestOMElement(i));
>                 try {
>                     Thread.sleep(1000);
>                 } catch (InterruptedException e) {
>                 }
>    }
> private OMElement getTestOMElement(long number) {
>         OMFactory omFactory = OMAbstractFactory.getOMFactory();
>         OMNamespace omNamespace = omFactory.createOMNamespace("http://wso2.org/temp1", "ns1");
>         OMElement omElement = omFactory.createOMElement("TestElement", omNamespace);
>         omElement.setText("org element " + number);
>         return omElement;
>     }
> so I expects a 1 - 100 message sequence as follows on the server side console.
> Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 1</ns1:TestElement>
> Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 2</ns1:TestElement>
> Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 3</ns1:TestElement>
> but there were some missing messages in this sequence
> Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 14</ns1:TestElement>
> Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 15</ns1:TestElement>
> Got the soap message ==> <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 17</ns1:TestElement>
> However message sequence terminates properly. but server sends acknowledgments only for 96 messsages.
> Then I went through each and every message using tcp mon and saw the following.
> <wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" soapenv:mustUnderstand="1">
>             <wsrm:Identifier>urn:uuid:63C7D88DAE5A969F4C1224742882720</wsrm:Identifier>
>             <wsrm:MessageNumber>15</wsrm:MessageNumber>
>          </wsrm:Sequence>
>       </soapenv:Header>
>       <soapenv:Body>
>          <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 15</ns1:TestElement>
>       </soapenv:Body>
> <wsrm:Sequence xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm" soapenv:mustUnderstand="1">
>             <wsrm:Identifier>urn:uuid:63C7D88DAE5A969F4C1224742882720</wsrm:Identifier>
>             <wsrm:MessageNumber>15</wsrm:MessageNumber>
>          </wsrm:Sequence>
>       </soapenv:Header>
>       <soapenv:Body>
>          <ns1:TestElement xmlns:ns1="http://wso2.org/temp1">org element 16</ns1:TestElement>
>       </soapenv:Body>
> So the reason is that the message number 15 is repeated in two messages. But this did not happen with the Inmemory mode. Seems to be a transaction handling problem. I am testing with the Derby data base.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.