Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-1925

Mapping tool needs to recognize the use of tablespaces for DB2 on z/OS

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.4, 1.1.0, 1.2.2, 1.2.3, 1.3.0, 2.0.1, 2.0.2, 2.1.0, 2.2.0
    • None
    • tooling
    • None
    • DB2 on z/OS

    Description

      The problem is by default OpenJPA tries to create tables in the default system database. Most DB2 on z/OS users do not have authority to do this and need their own database and possibly table space to store the data. I had to manually generate the DDL to create the tables using the mapping tool then edit it before running the SQL. For example following is part of the default DDL that was generated.

      CREATE TABLE SchemaToUse.Ask (id BIGINT NOT NULL, price DOUBLE, volume INTEGER, version INTEGER, STOCK_SYMBOL VARCHAR(254), TRADE_ID BIGINT, SELLER_NAME VARCHAR(254), PRIMARY KEY (id));

      And following is the create table statement I had to use to create the table on z/OS.

      CREATE TABLE SchemaToUse.Ask (id BIGINT NOT NULL, price DOUBLE, volume INTEGER, version INTEGER, STOCK_SYMBOL VARCHAR(254), TRADE_ID BIGINT, SELLER_NAME VARCHAR(254), PRIMARY KEY (id)) in databaseName.tablespaceName;

      A default index was not created on the primary key so I also had to execute

      CREATE UNIQUE INDEX schemaToUse.idx1 ON schemaToUse.Ask (ID ASC);

      Also, I could not get the mapping Ant task to work after reading the documentation so had to create a batch file with hard coded paths to run the mapping tool. Adding a schema export target to OpenJPA samples could be a useful addition.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kwsutter Kevin W. Sutter
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: