Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Incomplete
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.0pe
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      822

      Description

      I'm trying to add a H2 Platform for the new database engine H2
      (http://www.h2database.com). Could you please tell me how to set the platform,
      and what are the expected results of the test?

      I got the source code and built the app server
      (https://glassfish.dev.java.net/public/BuildGlassFish.html), this was quite
      easy. I also run the unit tests as described in
      entity-persistence-tests/readme.txt, but then there where some problems. I think
      it has to do with some settings.

      • The test framework always uses the (generic) DatabasePlatform for me. I
        renamed the platform classes to work around this problem.
      • The sequences are not created (but used) inside the test cases. I worked
        around this by manually creating the sequences.

      My build.properties:

      jdbc.driver.jar=D:/data/h2test/h2.jar
      db.driver=org.h2.Driver
      db.url=jdbc:h2:test2;TRACE_LEVEL_FILE=3;LOCK_MODE=0
      db.user=sa
      db.pwd=
      tl.platform=oracle.toplink.essentials.platform.database.HSQLPlatform
      db.type=false
      result.file=testresults
      junit.location=../appserv-tests/lib/junit.jar
      src.dir=src/java
      component.classes.dir=build/main_jar
      validation.classes.dir=build/validation_jar

      I don't think that tl.platform actually has an effect. I can write 'bla' and the
      result is the same.

      Sequence init script:
      CREATE SEQUENCE SCIENTIST_SEQ INCREMENT BY 1;
      CREATE SEQUENCE PROJECT_SEQ START WITH 10 INCREMENT BY 10;
      CREATE SEQUENCE ADDRESS_SEQ START WITH 25 INCREMENT BY 25;
      CREATE SEQUENCE BUYER_SEQ START WITH 10 INCREMENT BY 10;
      CREATE SEQUENCE XML_MERGE_PROJECT_SEQ START WITH 10 INCREMENT BY 10;
      CREATE SEQUENCE XML_MERGE_ADDRESS_SEQ START WITH 25 INCREMENT BY 25;
      CREATE TABLE CMP3_XML_EMPLOYEE_SEQ(SEQ_COUNT BIGINT, SEQ_NAME VARCHAR);
      INSERT INTO CMP3_XML_EMPLOYEE_SEQ VALUES(1, 'EMPLOYEE_SEQ');

      This is the procedure use to run the tests:
      maven clean
      maven build
      del *.db
      <run the init script>
      ant test

      Most missing functionality in H2 is now implemented (in the next release), the
      test results are:

      Tests run: 482, Failures: 4, Errors: 2, Time elapsed: 42.734 sec

      Is the expected result is 0 failures / errors?

      Thanks,
      Thomas

        Activity

        Hide
        mf125085 added a comment -

        tl.platform might not be used anymore. See

        <http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-extensions.html#TopLinkDBSessionAppServer>

        for how to specify your database. Please note, that the persistence.xml used in
        entity-persistence-tests is generated from

        entity-persistence-tests/config/META-INF/persistence.xml

        Also, I know that entity-persistence-tests are supposed to succeed against
        Oracle and JavaDB (in network mode) w/o failures. I don't know about other dbs.
        It would be great if you could investigate the failures, if they're setup
        problems or bugs. If they're bugs, please feel free to file them here.

        Show
        mf125085 added a comment - tl.platform might not be used anymore. See < http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-extensions.html#TopLinkDBSessionAppServer > for how to specify your database. Please note, that the persistence.xml used in entity-persistence-tests is generated from entity-persistence-tests/config/META-INF/persistence.xml Also, I know that entity-persistence-tests are supposed to succeed against Oracle and JavaDB (in network mode) w/o failures. I don't know about other dbs. It would be great if you could investigate the failures, if they're setup problems or bugs. If they're bugs, please feel free to file them here.
        Hide
        marina vatkina added a comment -

        Downgraded to keep it open for a bit longer

        Show
        marina vatkina added a comment - Downgraded to keep it open for a bit longer
        Hide
        ijuma added a comment -

        Adding myself to cc list.

        Show
        ijuma added a comment - Adding myself to cc list.
        Hide
        mf125085 added a comment -

        Hi Thomas,

        You are right, tl.platform is not used anymore to define the test platform.
        toplink-essentials-tests now uses database auto detection for this purpose.

        Database detection first calls

        conn.getMetaData().getDatabaseProductName()

        and matches the result against a mapping defined in

        oracle/toplink/essentials/internal/helper/VendorNameToPlatformMapping.properties

        The syntax of this file is pretty self-explanatory. Please let me know if you
        have questions. To run the tests against H2, please update
        VendorNameToPlatformMapping.properties with the appropriate entry for H2 and
        package it into toplink-essentials.jar.

        Also: Please let us know, how VendorNameToPlatformMapping.properties must be
        updated thaT we can do the same change in the repository version.

        – markus.

        Show
        mf125085 added a comment - Hi Thomas, You are right, tl.platform is not used anymore to define the test platform. toplink-essentials-tests now uses database auto detection for this purpose. Database detection first calls conn.getMetaData().getDatabaseProductName() and matches the result against a mapping defined in oracle/toplink/essentials/internal/helper/VendorNameToPlatformMapping.properties The syntax of this file is pretty self-explanatory. Please let me know if you have questions. To run the tests against H2, please update VendorNameToPlatformMapping.properties with the appropriate entry for H2 and package it into toplink-essentials.jar. Also: Please let us know, how VendorNameToPlatformMapping.properties must be updated thaT we can do the same change in the repository version. – markus.
        Hide
        mf125085 added a comment -

        Closing this issue. The comments describe, how to add a new database platform.
        Hhow to run the tests against an established database is described in
        entity-persistence-tests/readme.txt.

        Show
        mf125085 added a comment - Closing this issue. The comments describe, how to add a new database platform. Hhow to run the tests against an established database is described in entity-persistence-tests/readme.txt.

          People

          • Assignee:
            mf125085
            Reporter:
            thomasmueller2
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: