You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Miguel Ángel Jiménez <mi...@gmail.com> on 2007/04/25 20:25:53 UTC

Bundle support for PostgreSQL

I've managed to create the DDL file needed to support bundle persistence
manager with PostgreSQL, but found some issues. I've mapped the id column of
table ${schemaObjectPrefix}NAMES to a serial datatype (equivalent to an
auto-increment column in MySQL). However, starting the repository yields a
exception in class
org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex, line 76:

.
nameInsert = con.prepareStatement("insert into " + schemaObjectPrefix +
"NAMES (NAME) values (?)", Statement.RETURN_GENERATED_KEYS);
.

It seems that PostgreSQL JDBC driver does not support RETURN_GENERATED_KEYS
feature.

Is there a plan to add bundling support to PostgreSQL? Before
PostgreSQL 8.2the only way I remember to get the auto-generated key is
by means of a
further select to get the last assigned value of the sequence but it does
not mean there are other alternatives.

-- 
Miguel.

Re: Bundle support for PostgreSQL

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 4/26/07, Miguel Ángel Jiménez <mi...@gmail.com> wrote:
> HI, I'm very interested in contributing. This feature seems a good starting
> point, so I'll try. I have downloaded the sources from the SVN repositories
> and I'm quite familiarized with the build cycle.

Excellent! Let us know if you need any help.

> I've created a request for feature in JIRA, including the ddl I've made for
> the preliminary tests:
>
> http://issues.apache.org/jira/browse/JCR-889

Looks good, thanks!

BR,

Jukka Zitting

Re: Bundle support for PostgreSQL

Posted by Miguel Ángel Jiménez <mi...@gmail.com>.
HI, I'm very interested in contributing. This feature seems a good starting
point, so I'll try. I have downloaded the sources from the SVN repositories
and I'm quite familiarized with the build cycle.

I've created a request for feature in JIRA, including the ddl I've made for
the preliminary tests:

http://issues.apache.org/jira/browse/JCR-889

Regards,

On 25/04/07, Jukka Zitting <ju...@gmail.com> wrote:
>
> Hi,
>
> On 4/25/07, Miguel Ángel Jiménez <mi...@gmail.com> wrote:
> > I've managed to create the DDL file needed to support bundle persistence
> > manager with PostgreSQL, but found some issues. I've mapped the id
> column of
> > table ${schemaObjectPrefix}NAMES to a serial datatype (equivalent to an
> > auto-increment column in MySQL). However, starting the repository yields
> a
> > exception in class
> > org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex , line
> 76:
> >
> > nameInsert = con.prepareStatement("insert into " + schemaObjectPrefix +
> > "NAMES (NAME) values (?)", Statement.RETURN_GENERATED_KEYS);
> >
> > It seems that PostgreSQL JDBC driver does not support
> > RETURN_GENERATED_KEYS feature.
>
> You're right.
>
> > Is there a plan to add bundling support to PostgreSQL? Before
> > PostgreSQL 8.2the only way I remember to get the auto-generated key is
> > by means of a further select to get the last assigned value of the
> sequence
> > but it does not mean there are other alternatives.
>
> You might want to file a feature request for PostgreSQL support. It
> would be great if you'd also like to contribute your DDL file as a
> starting point for resolving the issue.
>
> If you're (or someone else is) interested in trying to work around the
> RETURN_GENERATED_KEYS issue, the best way to do that would be to
> create a bundle persistence manager subclass that overrides the
> troublesome method with PostgreSQL-specific code.
>
> BR,
>
> Jukka Zitting
>



-- 
Miguel.

Re: Bundle support for PostgreSQL

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 4/25/07, Miguel Ángel Jiménez <mi...@gmail.com> wrote:
> I've managed to create the DDL file needed to support bundle persistence
> manager with PostgreSQL, but found some issues. I've mapped the id column of
> table ${schemaObjectPrefix}NAMES to a serial datatype (equivalent to an
> auto-increment column in MySQL). However, starting the repository yields a
> exception in class
> org.apache.jackrabbit.core.persistence.bundle.util.DbNameIndex, line 76:
>
> nameInsert = con.prepareStatement("insert into " + schemaObjectPrefix +
> "NAMES (NAME) values (?)", Statement.RETURN_GENERATED_KEYS);
>
> It seems that PostgreSQL JDBC driver does not support
> RETURN_GENERATED_KEYS feature.

You're right.

> Is there a plan to add bundling support to PostgreSQL? Before
> PostgreSQL 8.2the only way I remember to get the auto-generated key is
> by means of a further select to get the last assigned value of the sequence
> but it does not mean there are other alternatives.

You might want to file a feature request for PostgreSQL support. It
would be great if you'd also like to contribute your DDL file as a
starting point for resolving the issue.

If you're (or someone else is) interested in trying to work around the
RETURN_GENERATED_KEYS issue, the best way to do that would be to
create a bundle persistence manager subclass that overrides the
troublesome method with PostgreSQL-specific code.

BR,

Jukka Zitting