openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B.J. Reed (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-1326) ReverseMappingTool and SchemaTool failing for Sybase
Date Wed, 23 Sep 2009 15:44:15 GMT
ReverseMappingTool and SchemaTool failing for Sybase
----------------------------------------------------

                 Key: OPENJPA-1326
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1326
             Project: OpenJPA
          Issue Type: Bug
          Components: sql
    Affects Versions: 1.2.2
         Environment: Sybase
            Reporter: B.J. Reed
            Assignee: B.J. Reed
             Fix For: 1.2.2


invoking the org.apache.openjpa.jdbc.ant.ReverseMappingToolTask or the org.apache.openjpa.jdbc.ant.SchemaToolTask
on a Sybase database gives the following stack trace

java.sql.SQLException: S0022: Invalid column name 'TABLE_SCHEM'.
 	at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(ErrorMessage.java:559)
 	at com.sybase.jdbc3.tds.TdsResultSet.findColumn(TdsResultSet.java:624)
 	at com.sybase.jdbc3.jdbc.SybResultSet.findColumn(SybResultSet.java:602)
	at com.sybase.jdbc3.jdbc.SybResultSet.getString(SybResultSet.java:349)
 	at org.apache.openjpa.jdbc.sql.DBDictionary.newPrimaryKey(DBDictionary.java:3769)
 	at org.apache.openjpa.jdbc.sql.DBDictionary.getPrimaryKeysFromGetPrimaryKeys(DBDictionary.java:3751)
	at org.apache.openjpa.jdbc.sql.DBDictionary.getPrimaryKeys(DBDictionary.java:3728)
 	at org.apache.openjpa.jdbc.schema.SchemaGenerator.generatePrimaryKeys(SchemaGenerator.java:586)
	at org.apache.openjpa.jdbc.schema.SchemaGenerator.generatePrimaryKeys(SchemaGenerator.java:593)
 	at org.apache.openjpa.jdbc.schema.SchemaGenerator.generatePrimaryKeys(SchemaGenerator.java:367)
 	at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:274)
	at org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:243)
	at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:1433)
	at org.apache.openjpa.jdbc.ant.SchemaToolTask.executeOn(SchemaToolTask.java:138)
	at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:172)
 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:341)
 	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
 	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
 	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:341)
 	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
 	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
 	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
 	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
	at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
 	at org.apache.tools.ant.Task.perform(Task.java:364)
 	at org.apache.tools.ant.Target.execute(Target.java:341)
	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
 	at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
 	at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
 	at org.apache.tools.ant.Main.runBuild(Main.java:687)
	at org.apache.tools.ant.Main.startAnt(Main.java:200)
 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

The data looks good from the driver, but when doing the getString calls, it has problems finding
the columns that are aliased AS something else (ie, table_owner AS TABLE_SCHEM).  A quick
fix is to just use the original column names when getting the data from Sybase.

pk.setSchemaName(pkMeta.getString("table_owner")); (search by column name) works, but
pk.setSchemaName(pkMeta.getString("TABLE_SCHEM")); (search by column label) does not.



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


Mime
View raw message