You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Miguel Angel Jiménez Sampedro (JIRA)" <ji...@apache.org> on 2007/04/26 10:37:15 UTC

[jira] Created: (JCR-889) Add bundle support for PostgreSQL

Add bundle support for PostgreSQL
---------------------------------

                 Key: JCR-889
                 URL: https://issues.apache.org/jira/browse/JCR-889
             Project: Jackrabbit
          Issue Type: New Feature
    Affects Versions: 1.3
            Reporter: Miguel Angel Jiménez Sampedro
            Priority: Minor


The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-889) Add bundle support for PostgreSQL

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506207 ] 

Alexander Klimetschek commented on JCR-889:
-------------------------------------------

We have used that with Jackrabbit 1.3 and a PostgeSQL 8.2 and can confirm that it works, using the PM for workspaces and versions.

As Postgres 8.2 has useful new features, we improved the implementation and schema for 8.2. It has another index and the new 8.2 "RETURNING" feature, that allows to reduce the 2 statements going through the index to 1.

The two changes are a different schema and a different PostgreSQLNameIndex class. The PostgreSQLPersistenceManager class needs no changes.

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Klimetschek updated JCR-889:
--------------------------------------

    Attachment: postgresql.ddl

The schema, only working with postgres > 8.2

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: postgresql.ddl, postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Miguel Angel Jiménez Sampedro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Miguel Angel Jiménez Sampedro updated JCR-889:
----------------------------------------------

    Attachment: PostgreSQLPersistenceManager.java

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Priority: Minor
>         Attachments: postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Miguel Angel Jiménez Sampedro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Miguel Angel Jiménez Sampedro updated JCR-889:
----------------------------------------------

    Attachment: PostgreSQLNameIndex.java

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Priority: Minor
>         Attachments: postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-889) Add bundle support for PostgreSQL

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506212 ] 

Alexander Klimetschek commented on JCR-889:
-------------------------------------------

Not to forget: thanks to Hagen Overdick, our PostgreSQL expert, who did the work.

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: postgresql.ddl, postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-889) Add bundle support for PostgreSQL

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-889.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.4
         Assignee: Jukka Zitting

Excellent, thanks a lot!

I committed the files with minor changes in revision 541146. I don't have a PostgreSQL installation at hand right now, so I couldn't test that it actually works, but the code seems to do all the right things. Please test and reopen this issue if necessary.

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>         Assigned To: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Miguel Angel Jiménez Sampedro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Miguel Angel Jiménez Sampedro updated JCR-889:
----------------------------------------------

    Attachment: postgresql.ddl

This is the starting ddl I'm using on my tests with PostgreSQL.

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>    Affects Versions: 1.3
>            Reporter: Miguel Angel Jiménez Sampedro
>            Priority: Minor
>         Attachments: postgresql.ddl
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-889:
------------------------------

          Component/s: core
    Affects Version/s:     (was: 1.3)

Looks good. Any progress on the modifications required work around the RETURN_GENERATED_KEYS issue?

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Priority: Minor
>         Attachments: postgresql.ddl
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Klimetschek updated JCR-889:
--------------------------------------

    Attachment: PostgreSQLNameIndex.java

The slightly modifed PostgreSQLNameIndex class. Again, only for >= 8.2

(Note that the > 8.2 in the previous file upload comment was meant to be >= 8.2 ;-)

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: postgresql.ddl, postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-889) Add bundle support for PostgreSQL

Posted by "Miguel Angel Jiménez Sampedro (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497992 ] 

Miguel Angel Jiménez Sampedro commented on JCR-889:
---------------------------------------------------

I have a solution tested extensively in our development environment, so I'm pretty sure it will work. The solution includes two new classes:

org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager
org.apache.jackrabbit.core.persistence.bundle.util.PostgreSQLNameIndex

And the new ddl file to generate the schema.

The work around to retrieve the generated key in postgres is implemented in PostgreSQLNameIndex. After doing the insert into <schemaObjectPrefix>NAMES table, the generated key is retrieved doing a second query on the implicit sequence that assigns values to the primary key column. It's very similar to the NGKDbNameIndex class in that same package, but the query is very specific to PostgreSQL and looks like this:

select currval(<schemaObjectPrefix>NAMES_ID_SEQ')

This is the link to the PostgreSQL documentation on the currval function: http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html

I have tested it with a PostgreSQL 7.4, 8.0 and 8.1. I am attaching these files here for you to test, modify and hopefully integrate in the SVN repositories. As written before, feel free to make any changes in these files.

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Priority: Minor
>         Attachments: postgresql.ddl
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-889) Add bundle support for PostgreSQL

Posted by "Miguel Angel Jiménez Sampedro (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-889?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Miguel Angel Jiménez Sampedro updated JCR-889:
----------------------------------------------

    Attachment: postgresql.ddl

This is the new ddl for PostgreSQL

> Add bundle support for PostgreSQL
> ---------------------------------
>
>                 Key: JCR-889
>                 URL: https://issues.apache.org/jira/browse/JCR-889
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: core
>            Reporter: Miguel Angel Jiménez Sampedro
>            Priority: Minor
>         Attachments: postgresql.ddl, postgresql.ddl, PostgreSQLNameIndex.java, PostgreSQLPersistenceManager.java
>
>
> The class DbNameIndex does not work with this RDBMS since the RETURN_GENERATED_KEYS JDBC feature is not implemented in current PostgreSQL drivers.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.