You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Fredrik Jonson <fr...@jonson.org> on 2012/06/10 12:04:52 UTC

Verified database matrix (was: PostgreSQL 9.1 [Error :current transaction is aborted])

Kevin Sutter wrote:

>  It looks like OpenJPA has only been tested with v8.4.
>  http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#dbsupport

Wonder if that's not mostly a sign that this section of the docs is outdated?

Otherwise: what is the procedure for getting a not-so-ancient verison of
postgresql on to that list? Since 8.4, we've seen 9.0 released in 2010, and 9.1
released in 2011. I've used postgresql 9.0 and 9.1 with openjpa, and apart
from issue 2056 I haven't found any obvious incompatibilities.

https://issues.apache.org/jira/browse/OPENJPA-2056

--
Fredrik Jonson


Re: Verified database matrix (was: PostgreSQL 9.1 [Error :current transaction is aborted])

Posted by ubiteck <su...@gmail.com>.
Kevin,
As recommended I created a JIRA  OPENJPA-2297
<https://issues.apache.org/jira/browse/OPENJPA-2297>  
I'm using PostgreSQL 8.4 with Geronimo 3.0, JDK 1.6 Sébastien



--
View this message in context: http://openjpa.208410.n2.nabble.com/PostgreSQL-9-1-Error-current-transaction-is-aborted-tp7580209p7581684.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Verified database matrix (was: PostgreSQL 9.1 [Error :current transaction is aborted])

Posted by Kevin Sutter <kw...@gmail.com>.
Hi sursini,
Excellent debug work!  I took a look at the code and you are right.  The
buildNames() method is using the underscore as the separator and causing
the issue.  Can you create a JIRA for this issue?  Thank you.

Just curious, what type of runtime environment are you using OpenJPA and
Postgres?  JSE?  App Server?  Which one?  Just a random survey...  :-)
Thanks!

Kevin

On Thu, Nov 8, 2012 at 3:56 AM, ubiteck <su...@gmail.com> wrote:

> 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.

Re: Verified database matrix (was: PostgreSQL 9.1 [Error :current transaction is aborted])

Posted by ubiteck <su...@gmail.com>.
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.

Re: Verified database matrix (was: PostgreSQL 9.1 [Error :current transaction is aborted])

Posted by Kevin Sutter <kw...@gmail.com>.
Hi Fredrik,
Good to know that Postgres v9.0 and v9.1 are working for you.  The OpenJPA
documentation could very well be out of date.  But, we do rely on
volunteers to perform testing and verification of the various database
versions.  Especially with the open-source database variations.

Due to the recent questions regarding Postgres on the mailing lists, I did
reach out to the developer that used to "maintain" the Postgres
DBDictionary.  Unfortunately, he has some new responsibilities and will not
be able to perform the verification that he used to perform for Postgres.
So, we are looking for a new volunteer...

OpenJPA has a large suite of JUnits.  By default, the test bucket is run
with Derby, but it is easily configurable to run with other databases.  If
anybody has the bandwidth to run the JUnit bucket against newer versions of
Postgres and follow-up with any incompatibilities, it would be greatly
appreciated!  And, then maybe we can get the documentation up-to-date...
:-)

Thanks,
Kevin

On Sun, Jun 10, 2012 at 5:04 AM, Fredrik Jonson <fr...@jonson.org> wrote:

> Kevin Sutter wrote:
>
> >  It looks like OpenJPA has only been tested with v8.4.
> >
> http://openjpa.apache.org/builds/latest/docs/docbook/manual.html#dbsupport
>
> Wonder if that's not mostly a sign that this section of the docs is
> outdated?
>
> Otherwise: what is the procedure for getting a not-so-ancient verison of
> postgresql on to that list? Since 8.4, we've seen 9.0 released in 2010,
> and 9.1
> released in 2011. I've used postgresql 9.0 and 9.1 with openjpa, and apart
> from issue 2056 I haven't found any obvious incompatibilities.
>
> https://issues.apache.org/jira/browse/OPENJPA-2056
>
> --
> Fredrik Jonson
>
>