Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75E67D0FB for ; Thu, 8 Nov 2012 09:56:36 +0000 (UTC) Received: (qmail 61273 invoked by uid 500); 8 Nov 2012 09:56:36 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 61189 invoked by uid 500); 8 Nov 2012 09:56:36 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 61162 invoked by uid 99); 8 Nov 2012 09:56:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 09:56:35 +0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.250.139 is neither permitted nor denied by domain of sursini@gmail.com) Received: from [216.139.250.139] (HELO joe.nabble.com) (216.139.250.139) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 09:56:30 +0000 Received: from jim.nabble.com ([192.168.236.80]) by joe.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TWOqH-0002Ha-LX for users@openjpa.apache.org; Thu, 08 Nov 2012 01:56:09 -0800 Date: Thu, 8 Nov 2012 01:56:09 -0800 (PST) From: ubiteck To: users@openjpa.apache.org Message-ID: <1352368569651-7581664.post@n2.nabble.com> In-Reply-To: References: <1338883815011-7580209.post@n2.nabble.com> Subject: Re: Verified database matrix (was: PostgreSQL 9.1 [Error :current transaction is aborted]) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1096572_21307242.1352368569659" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_1096572_21307242.1352368569659 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I found the issue. The problem is related to the use of the underscore in table name. Let's imagine you have an entity called *SubscriptionEvent *with an auto generated field called *id* (/GenerationType.IDENTITY/). You want OpenJPA to create a table named SUBSCRIPTION_EVENT by using the following annotation to please you DBA with is favorite naming convention : @Table(name="SUBSCRIPTION_EVENT") The problem occurs when the class PostgresDictionary try to determine whether a sequence is owned by the database using the method is /isOwnedSequence/. This method use another method called *buildNames* to define what is the table name and the column name to provide the parameters to the sql statement : SELECT pg_get_serial_sequence(?, ?) The argument provided to *buildNames* according to the name provided in the annotation @Table and the identity field is : "subscription_event_id". BuildNames split this string using the underscore as separator interpreting this : * Table name : * subscription * Column name :* event_id instead of * Table name :* subscription_event *Column name :* id As a workaround you have to remove the underscore in you table or field name. But it is in my opinion a bug to rely on the underscore to split the table from the column name. -- View this message in context: http://openjpa.208410.n2.nabble.com/PostgreSQL-9-1-Error-current-transaction-is-aborted-tp7580209p7581664.html Sent from the OpenJPA Users mailing list archive at Nabble.com. ------=_Part_1096572_21307242.1352368569659--