X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 56049D8130 for ; Sun, 28 Aug 2005 16:50:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67120-08 for ; Sun, 28 Aug 2005 19:50:37 +0000 (GMT) Received: from relais.videotron.ca (relais.videotron.ca [24.201.245.36]) by svr1.postgresql.org (Postfix) with ESMTP id 3ADC3D818A for ; Sun, 28 Aug 2005 16:50:34 -0300 (ADT) Received: from [192.168.1.100] ([24.202.23.128]) by VL-MO-MR001.ip.videotron.ca (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0ILY00GXB74CL5@VL-MO-MR001.ip.videotron.ca> for pgsql-jdbc@postgresql.org; Sun, 28 Aug 2005 15:50:36 -0400 (EDT) Date: Sun, 28 Aug 2005 15:51:53 -0400 From: David Gagnon Subject: Re: implementing asynchronous notifications PLEASE CONFIRM MY In-reply-to: <4312822A.8030007@menelic.com> To: "Arcadius A." Cc: pgsql-jdbc@postgresql.org Message-id: <431215D9.8080805@siunik.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) References: <4265A05C.6050302@opencloud.com> <42667C72.9070708@siunik.com> <4266E296.6050105@opencloud.com> <4308AF3A.2070400@siunik.com> <43120302.9030509@menelic.com> <4311C6AB.1020607@siunik.com> <4312822A.8030007@menelic.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.025 required=5 tests=[AWL=0.025] X-Spam-Level: X-Archive-Number: 200508/190 X-Sequence-Number: 13759 Arcadius A. wrote: > David Gagnon wrote: > >> Hi , >> >> Thanks for your answer, see my answer below.. >> >>> David Gagnon wrote: >>> >>>> Hi all, >>> >>> > [...] > >>> >>> However I do not know your exact requirement, if I were to solve >>> such a problem, I would not try to put any overhead on the DB >>> server; after all, the purpose of caching is to give a brake to the >>> DBServer. >>> >>> In fact, the easiest way to have the cache in sync with the DB is to >>> have a kind of Facade , a unique class, with static methods for >>> reading/writing data for both the cache and the DB. >>> >>> Using a single class for reading/writing , you won't need the DB to >>> notify you of changes since all call go through your facade, that >>> means that you know when things are being changed and can take action. >>> >>> However, your requirements my be different. >>> >>> >>> Regards. \ >> >> >> > [...] > >> The big problem is that when a user launch a stored procedure.. >> chance are that he will consult the other data right after the >> completion of the stored procedure. If data have not been updated in >> the cache I will display invalid data :-( >> > If the user is calling the SP from the same Java app , then , what I > said before is still valid. > The method which calls the SP should clear/invalidate the cache . > So, the next time the user tries to view data, as the cache is > empty/invalidated , new stuff should be loaded from the DB. The business logic in the stored procedure are to much complex to know what gone be changed... at least I cannot be sure ... And that would be really complicated and cumbersome tring to guess... and frankly impossible... It's not an easy problem since the business logic is quite complicated .. .So lot of stored procedure and lot of SP that calls others SP. Thanks for your help Regards /David