Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TECsW-0002gY-Sw for pgsql-bugs@postgresql.org; Wed, 19 Sep 2012 05:31:17 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TECsU-0001HH-Ca for pgsql-bugs@postgresql.org; Wed, 19 Sep 2012 05:31:15 +0000 Received: by pbbrr13 with SMTP id rr13so1610227pbb.19 for ; Tue, 18 Sep 2012 22:31:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=CbCiphndpFIZtbcUIlXQjRJSORuSry/0wjgl9xzOtOA=; b=P7Em7B3ctv/d7RAMBzu2UgQ1sWBnLtt8KQVyif0OH8D3JH36VzQZqVWvt1kHYN9QjQ OtzZId/nkuDODaTT3+qWUMfKkHV0G1LLZnMCHMfcPW6GaDDh69IbsKjfm7TkmWzTsu9T Ahf29N8NqCZp2l/NJaw094OeT6Xi4zctuoCu7myot69hqn0SlicStoKoI5tjFod5/7V1 cJSaO7z9i0cnopDsRlyQt55+xX33GtlI9R3wSKLyh1joSU/S2nbJ24k0pFrawoShCZmf F0qpWqUKUtrOrWyn6DF6LZ40+SaWjkG6YeqaQ6+Six+Bec10paxMQjOP1kZQWfwyEphP XkUQ== Received: by 10.68.132.69 with SMTP id os5mr4499753pbb.94.1348032673216; Tue, 18 Sep 2012 22:31:13 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id rz10sm1216079pbc.32.2012.09.18.22.31.10 (version=SSLv3 cipher=OTHER); Tue, 18 Sep 2012 22:31:12 -0700 (PDT) Message-ID: <5059589B.5020609@ringerc.id.au> Date: Wed, 19 Sep 2012 13:31:07 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Freddie Burgess CC: pgsql-bugs@postgresql.org Subject: Re: Postgres JDBC-hibernate Problem References: <000901cd9039$11ac90f0$3505b2d0$@radiantblue.com> <5056A94B.2030304@ringerc.id.au> <001001cd94f9$1c1f8e10$545eaa30$@radiantblue.com> <5057F892.7060208@ringerc.id.au> <003b01cd95d6$3babb0a0$b30311e0$@radiantblue.com> In-Reply-To: <003b01cd95d6$3babb0a0$b30311e0$@radiantblue.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk5ctfq5SwlSduv+9os6TqYgT3+1ibYfMIQYiJOOH0MyLTaK9N95vWn6tqnJX/7N5axshsv X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/206 X-Sequence-Number: 34200 On 09/19/2012 03:46 AM, Freddie Burgess wrote: > > The Employee ingest behaves a bit differently - it handles transactions > programmatically, for example: > > Transaction tx = session.beginTransaction(); > session.save(Employee); > tx.commit(); > > Could it be possible that if an exception is thrown by the session.save() > method that the transaction might not be rolled back or closed, although no > errors pertaining to this scenario were recorded in the PostgreSQL log. It's possible; I don't use Spring, so I can't really say. I know that in EJB 3.1 container managed transactions with JTA data sources the guarantees are strong: - If the exception thrown is annotated @ApplicationException then rollback is controlled by that annotation; otherwise: - If it's an unchecked exception, the transaction is rolled back; and - If it's a checked exception that's properly declared the transaction is NOT rolled back I don't know what Spring's rules are. It's all a bit localized and specific to your code, so it's difficult to offer any useful advice at this point. If there's any chance you can cook it down to a small, runnable, self-contained test-case that'd be very useful. In my experience when I've done so I have, in the process, often found a bug in my code that was the cause of the problem. When I don't find an issue in my code I usually have something clear that demonstrates a problem and helps isolate which project(s) the problem is in. -- Craig Ringer