[ 
https://issues.apache.org/jira/browse/OPENJPA-663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Albert Lee updated OPENJPA-663:
-------------------------------

    Fix Version/s: 1.3.0
                   1.2.1

> Index creation fails when default schema does not exist
> -------------------------------------------------------
>
>                 Key: OPENJPA-663
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-663
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 1.2.0
>         Environment: DB2 for iSeries / i5/OS.  Toolkit for Java JDBC driver.
>            Reporter: Jeremy Bauer
>             Fix For: 1.2.1, 1.3.0
>
>         Attachments: OPENJPA-663_doc.patch
>
>
> I have an entity which uses the org.apache.openjpa.persistence.jdbc.Index 
> annotation to specify an index on a field. When running against DB2 on 
> iSeries with the Toolkit for Java JDBC driver, the mapping tool is failing 
> with an internal SQLException when issuing the SQL to create the index.  Here 
> is the exception output:
> <openjpa-1.0.1-SNAPSHOT-runknown nonfatal general error> 
> org.apache.openjpa.persistence.PersistenceException: [SQL0204] MYUID in QSYS 
> type *LIB not found. {stmnt 1135625136 CREATE UNIQUE INDEX projid_index ON 
> myschema.ProjectBean (projid)} [code=-204, state=42704]
> Investigation determined that the problem is due to not specifying a default 
> library on the JDBC URL (myschema) and using a user login that does not have 
> a matching schema defined.  Neither are a requirement for iSeries.  The JDBC 
> driver chooses the user profile name as the default schema.  Unlike DB2 on 
> LUW, the schema name will not get created by default (or as the result of 
> another CREATE which uses the schema name) on iSeries, resulting in the error 
> above.
> Unlike most other annotations, the Index annotation does not allow a schema 
> to be specified.  In addition, the openjpa.jdbc.Schema property does not 
> affect index generation.  Since (at least on iSeries) indexes can be created 
> in a specific schema, the Index annotation should be enhanced to include an 
> attribute which allows specification of the schema name to use when creating 
> the index.
> This problem was found when using DB2 on iSeries, but could occur using any 
> database/JDBC driver which behaves similarly.

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

Reply via email to