Return-Path: Delivered-To: apmail-ws-sandesha-dev-archive@www.apache.org Received: (qmail 64987 invoked from network); 24 Oct 2008 10:04:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Oct 2008 10:04:08 -0000 Received: (qmail 59428 invoked by uid 500); 24 Oct 2008 10:04:11 -0000 Delivered-To: apmail-ws-sandesha-dev-archive@ws.apache.org Received: (qmail 58986 invoked by uid 500); 24 Oct 2008 10:04:09 -0000 Mailing-List: contact sandesha-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list sandesha-dev@ws.apache.org Received: (qmail 58884 invoked by uid 99); 24 Oct 2008 10:04:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Oct 2008 03:04:09 -0700 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of GATFORA@uk.ibm.com designates 195.212.29.138 as permitted sender) Received: from [195.212.29.138] (HELO mtagate5.uk.ibm.com) (195.212.29.138) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Oct 2008 10:02:57 +0000 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate5.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m9OA1A0x061650 for ; Fri, 24 Oct 2008 10:01:10 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m9OA1A2Z4366430 for ; Fri, 24 Oct 2008 11:01:10 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m9OA1AVi005744 for ; Fri, 24 Oct 2008 11:01:10 +0100 Received: from d06ml065.portsmouth.uk.ibm.com (d06ml065.portsmouth.uk.ibm.com [9.149.38.138]) by d06av02.portsmouth.uk.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m9OA1ALu005739; Fri, 24 Oct 2008 11:01:10 +0100 In-Reply-To: <60708f4b0810240226l6e25d96boccf15b0700c127b1@mail.gmail.com> References: <60708f4b0810240226l6e25d96boccf15b0700c127b1@mail.gmail.com> X-Disclaimed: 6830 To: "Amila Suriarachchi" Cc: "sandesha-dev@ws.apache.org" MIME-Version: 1.0 Subject: Re: Sandesha2 synchronization and dead lock handling. X-Mailer: Lotus Notes Release 8.0.1 February 07, 2008 From: Andrew K Gatford Message-ID: Date: Fri, 24 Oct 2008 11:01:10 +0100 X-MIMETrack: Serialize by Router on D06ML065/06/M/IBM(Release 8.0.1|February 07, 2008) at 24/10/2008 11:01:09, Serialize complete at 24/10/2008 11:01:09 Content-Type: text/plain; charset="US-ASCII" X-Virus-Checked: Checked by ClamAV on apache.org I went through similar pain when implementing a StorageManager and encountered a number of deadlocks similar to the ones that you describe. What I have gradually done is eliminate these in both the InMemory store and my store by changing the ordering the beans were taken in. In general the beans are taken in this order. RMSBean or RMDBean followed by SenderBean or InvokerBean. In cases where both the RMSBean and RMDBean are locked, they tend to be taken in that order - RMS followed by RMD. The one thing that I do know is that it is fairly easy to introduce new deadlocks by slightly altering the order that beans are read. The one question I have is how does the jdbc store handle multiple threads accessing multiple sequences, or even a single sequence, but with multiple threads sending multiple requests. From my experience this is where we have found a lot of problems in the InMemory store and I expect to be even more painful with a jdbc store. Andrew Gatford Technical Project Lead Websphere ESB Foundation Technologies Hursley MP211 IBM United Kingdom Laboratories, Hursley Park, Winchester, SO21 2JN Telephone : Internal (7) 245743 External 01962 815743 Internet : gatfora@uk.ibm.com From: "Amila Suriarachchi" To: "sandesha-dev@ws.apache.org" Date: 24/10/2008 10:30 Subject: Sandesha2 synchronization and dead lock handling. hi all, This is regarding the issue [1]. First of all as I learned Sandesha2 uses different beans to keep the state of the sequence and the messages. In a dual channel mode different threads can access these beans and update them concurrently. So the synchronization of these beans done by using the storage level transactions. Therefore Sandesha2 needs an storage which supports isolated transactions. To synchronize these beans the transactions must be completely isolated. i.e It should not allow simultaneous reads of same record from different transactions. Therefore I think the problem I saw on[1] because not isolating the transactions properly. Then I increased the transaction isolation to fix the above problem. It fixed that problem but results in dead locks. The reason I believe for this dead locks is that different transactions try to access the data base tables in different order. But unfortunately I could not fix the issue. Normally these types of dead locks are prevented by accessing resources in same order. Does Sandesha2 follows such a order or any other technique? Or is there any other reason for this dead locks and synchronization problems? Can someone have a better idea of Sandesha2 Design shed some light on this? thanks, Amila. [1] http://issues.apache.org/jira/browse/SANDESHA2-179 -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU --------------------------------------------------------------------- To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org For additional commands, e-mail: sandesha-dev-help@ws.apache.org