Spring Roo
  1. Spring Roo
  2. ROO-2625

Support Derby Client for persistence and dbre

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 1.1.5.RELEASE
    • Fix Version/s: 1.2.0.M1
    • Component/s: PERSISTENCE
    • Labels:

      Description

      persistence setup only offers the Derby embedded option, and the Roo add-on repository only provides a wrapped Derby embedded jar. Derby should have seperate embedded and client options (like Hypersonic does).

      Jar file: derbyclient.jar
      jdbc url: jdbc:derby://hostname[:port]/databaseName[;attributeKey=value]..
      driver class: org.apache.derby.jdbc.ClientDriver

      suggested default jdbc url: jdbc:derby://localhost:1527/sample;create=true
      By default, a Derby network server will only allow connections from localhost on port 1527. create=true will cause the network server to create a new db with the specified name if it doesn't already exist.

      persistence setup command substitution:
      --hostName should replace the hostName
      --databaseName should replace the databaseName
      --userName should append 'user=' and userName to jdbc url
      --password should append 'password=' and password to jdbc url

        Activity

        Hide
        Dan Price added a comment -

        I've got a patch to addon-jpa to add DERBY_CLIENT ready to go, would you like me to push it?

        Show
        Dan Price added a comment - I've got a patch to addon-jpa to add DERBY_CLIENT ready to go, would you like me to push it?
        Hide
        Dan Price added a comment -

        The userName and password don't need to be added to the connection URL. It seems to pick them up from the database.properties file just fine.

        Show
        Dan Price added a comment - The userName and password don't need to be added to the connection URL. It seems to pick them up from the database.properties file just fine.
        Hide
        Alan Stewart added a comment -

        --database option DERBY_CLIENT added and existing DERBY renamed to DERBY_EMBEDDED.

        Derby client jar wrapped as well and store on spring-roo-repository.springsource.org

        Show
        Alan Stewart added a comment - --database option DERBY_CLIENT added and existing DERBY renamed to DERBY_EMBEDDED. Derby client jar wrapped as well and store on spring-roo-repository.springsource.org
        Hide
        Dan Price added a comment -

        JpaOperationsImpl.java:
        getConnectionString (line 396) if the user passes a --databaseName to persistence setup, this will append the database name to the end of the URL, and look like "jdbc:derby//hostName:1527/projectName;create=true/databaseName". This won't work, the projectName (at least in the case for DERBY_CLIENT) should be replaced with the databaseName. I assume the system was using the projectName for a default dabaseName.

        There's a DERBY_EMBEDDED reference in the case statement at line 527, but no DERBY_CLIENT. That's mainly cosmetic, it won't emit the warning to edit the database.properties file.

        Show
        Dan Price added a comment - JpaOperationsImpl.java: getConnectionString (line 396) if the user passes a --databaseName to persistence setup, this will append the database name to the end of the URL, and look like "jdbc:derby//hostName:1527/projectName;create=true/databaseName". This won't work, the projectName (at least in the case for DERBY_CLIENT) should be replaced with the databaseName. I assume the system was using the projectName for a default dabaseName. There's a DERBY_EMBEDDED reference in the case statement at line 527, but no DERBY_CLIENT. That's mainly cosmetic, it won't emit the warning to edit the database.properties file.
        Hide
        Alan Stewart added a comment -

        Fixed in Git ID 87bde469baab255b9aad0d4aee99d4dbf8dace8d

        Show
        Alan Stewart added a comment - Fixed in Git ID 87bde469baab255b9aad0d4aee99d4dbf8dace8d

          People

          • Assignee:
            Alan Stewart
            Reporter:
            Dan Price
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: