Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhJMH-0005P2-I8 for pgsql-jdbc@arkaria.postgresql.org; Mon, 05 May 2014 13:55:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WhJMG-0000uV-QO for pgsql-jdbc@arkaria.postgresql.org; Mon, 05 May 2014 13:55:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhJMG-0000uP-15 for pgsql-jdbc@postgresql.org; Mon, 05 May 2014 13:55:04 +0000 Received: from nm10-vm0.bullet.mail.ne1.yahoo.com ([98.138.91.72]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WhJMB-0001R4-TD for pgsql-jdbc@postgresql.org; Mon, 05 May 2014 13:55:03 +0000 Received: from [98.138.100.118] by nm10.bullet.mail.ne1.yahoo.com with NNFMP; 05 May 2014 13:54:57 -0000 Received: from [98.138.101.169] by tm109.bullet.mail.ne1.yahoo.com with NNFMP; 05 May 2014 13:54:57 -0000 Received: from [127.0.0.1] by omp1080.mail.ne1.yahoo.com with NNFMP; 05 May 2014 13:54:57 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 603895.80876.bm@omp1080.mail.ne1.yahoo.com Received: (qmail 2972 invoked by uid 60001); 5 May 2014 13:54:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1399298097; bh=0Xdz0OpB1bjZXEXMu9wbIf6odppKthTpXdcEYSXhoDc=; h=References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=skY7Fqj6eXxe31h8VT2uaZsN8+jwummiVigj1q9ycFiD/LUtpbHvtizhcSA4VLFo8JbIqfStaQ6mcomftqOsovMt7mYRj5xAdvUrvdAXOOiOfGs3u5PRHOj6SKvWE009ZrVk19EEHL/o825FaDTEkreDWcZU/4iaGppOg6iJiws= X-YMail-OSG: pddHic8VM1kfNtPUW3wZYM65dusJxs0EGuP57tvnHYu5Km3 XJnTSk1UGTIAjarNhYxiklj4iH3rRXzrD1HTST9iLRPIJlSpSm2SeqVoH1IC qJ.Q_9Og34O2XkUcv5TcN5LgX1viuO3L7zPrF1rabNH4nmcmAzuFqE7pwxfE DkkFPCv90PqViTIvr3msAAO1i2F6ar5OlksNDBajsFTxS3Fg4Oe8PBa3dnwP 9c92SM5bNt5y.E9uiuVdsSirdrUk7rG7gZcaCkdszui1MhK.YD4lb3uQYE76 TMTI3THIzx2GGeHkp3KtNJxIxAScTsKegm4g4bVnOaazU7bZ3T3fMFrvcz.A Vh8NzzpT33zSvk1usSE6tEo.0Bf3iKzjcI2YSXkqsOSV29lO0_0KU9pvxsDn OpvK6sdC9RSTrAhKISTEUxd8dGpInMp57UMzidVOlR7Zt0KAbSdNRM39yFzT ryGqK38U0cVey3.RHeAwDYquvvf1OE57oLR5YZsw8gWgLlWbZRLATp_JAFSL 1DRdirWj6wf5XijPSdpSbQ4akJhY.ir_N4.hZR.dOu2_uO_Mxx87aGyuCjo3 7ZB84gM8kUnrA6Q5AHDyOMMhVzW.jlezuVRX9i3mVQdycY.2OJ6ZLS7d4CdT cwQ1EJi44anbqDsLMnnJk8iXplzGlkeApNOWwK0SMM5ssrU0- Received: from [24.178.25.147] by web122305.mail.ne1.yahoo.com via HTTP; Mon, 05 May 2014 06:54:57 PDT X-Rocket-MIMEInfo: 002.001, THVkb3ZpYyBQT0xMRVQgPGx1ZG92aWMucG9sbGV0QGt1cm1pLXNvZnR3YXJlLmNvbT4gd3JvdGU6Cgo.IFdlIGFyZSBmYWNpbmcgYSBidWcgd2hlcmUgb3VyIGFwcGxpY2F0aW9uIGNhbm5vdCByZWFkIGEgTG9iCj4gYmVjYXVzZSBvZiBjb25jdXJyZW50IHJlbW92YWwuIEhvd2V2ZXIsIHdlIGFyZSB1c2luZyB0aGUKPiBzZXJpYWxpemFibGUgaXNvbGF0aW9uIGxldmVsIGFuZCBhIGNvcnJlY3QgdHJhbnNhY3Rpb24gc2NvcGUuCj4gV2UncmUgdXNpbmcgdGhlIGxhdGVzdCBKREJDIGRyaXZlciBzbmFwc2hvdCABMAEBAQE- X-Mailer: YahooMailWebService/0.8.188.663 References: <20140115124935.30128.15593@wrigleys.postgresql.org> <20140416175501.GG7443@momjian.us> Message-ID: <1399298097.47090.YahooMailNeo@web122305.mail.ne1.yahoo.com> Date: Mon, 5 May 2014 06:54:57 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: TR: [BUGS] BUG #8842: lo_open/fastpath transaction inconsistency To: Ludovic POLLET , "pgsql-jdbc@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Ludovic POLLET wrote: > We are facing a bug where our application cannot read a Lob > because of concurrent removal. However, we are using the > serializable isolation level and a correct transaction scope. > We're using the latest JDBC driver snapshot (and hibernate but > that does not really matter). > > The problematic use case is basically a thread that read the LOB > while another thread replace it with a new one and release the > old one. In this case, the reader will get a "large object xxx > does not exist". > > From what I understand, it is due to the opening of the large > object that is always done in read/write mode and thus behave as > a read commited one (as written in the doc). > > This behaviour is at least very surprising especially when > working in SERIALIZABLE concurrency level. > > The attached patch implements the following changes: > -=A0 Opening the lob in read mode until a write function is called. > In such a case, the LOB will be reopened in read/write mode. It > totally solves my problem since our application does not modify > Lob, but creates new ones indeed. > -=A0 Deferring the first lo_open until a Blob function is really > called (hibernate seems to be creating blob even if it does not > even read them...) > > What do you think about these behaviors ? As one of the developers of the implementation of serializable transactions used by PostgreSQL, I remember that we needed to exclude large objects from the transaction serialization because it basically did not follow transactional semantics in any other regard.=A0 The only workaround I can think to suggest is to only insert and delete large objects -- never update them, and rely on the serialization of modifications to the OID columns which *reference* the large objects.=A0 Always add the large object before setting a reference to it, and always eliminate references to a large object before deleting it.=A0 A crash at the wrong time could leave a large object which is unreferenced, so you might want to look at the vacuumlo executable: http://www.postgresql.org/docs/current/static/vacuumlo.html Unfortunately, I don't know how that approach interacts with Hibernate or its use of the JDBC driver. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc