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 2C634D7D8F for ; Sun, 28 Aug 2005 15:35:24 -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 53553-07 for ; Sun, 28 Aug 2005 18:35:22 +0000 (GMT) Received: from smtp4.vol.cz (smtp4.vol.cz [195.250.128.79]) by svr1.postgresql.org (Postfix) with ESMTP id CDEE1D7C88 for ; Sun, 28 Aug 2005 15:35:19 -0300 (ADT) Received: from [10.0.0.1] (prg1-v-4-75.static.adsl.vol.cz [62.177.77.75]) by smtp4.vol.cz (Postfix) with ESMTP id 2964B168F49; Sun, 28 Aug 2005 20:35:19 +0200 (CEST) Message-ID: <4312822A.8030007@menelic.com> Date: Sun, 28 Aug 2005 20:34:02 -0700 From: "Arcadius A." User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Gagnon Cc: pgsql-jdbc@postgresql.org Subject: Re: implementing asynchronous notifications PLEASE CONFIRM MY 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> In-Reply-To: <4311C6AB.1020607@siunik.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.202 required=5 tests=[DATE_IN_FUTURE_06_12=1.202] X-Spam-Level: * X-Archive-Number: 200508/192 X-Sequence-Number: 13761 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. Regards. Arcadius.