I get exceptions on running the torque test project against oracle. E.G:
[junit] org.apache.torque.TorqueException: java.sql.SQLException:
Anweisungs-Handle nicht ausgef³hrt: getMetaData
[junit] at org.apache.torque.util.BasePeer.throwTorqueException
(BasePeer.java:106)
[junit] at org.apache.torque.util.BasePeer.doDelete
(BasePeer.java:438)
[junit] at org.apache.torque.util.BasePeer.doDelete
(BasePeer.java:337)
[junit] at org.apache.torque.test.BaseBookPeer.doDelete
(BaseBookPeer.java:516)
[junit] at org.apache.torque.test.BaseBookPeer.doDelete
(BaseBookPeer.java:493)
[junit] at org.apache.torque.BeanTestConditional.testSaves
(BeanTestConditional.java:276)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
[junit] Caused by: java.sql.SQLException: Anweisungs-Handle nicht
ausgef³hrt: getMetaData
[junit] at oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:112)
[junit] at oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:146)
[junit] at oracle.jdbc.driver.OracleResultSetImpl.getMetaData
(OracleResultSetImpl.java:135)
[junit] at oracle.jdbc.driver.OraclePreparedStatement.getMetaData
(OraclePreparedStatement.java:3985)
[junit] at com.workingdogs.village.Schema.schema(Schema.java:201)
[junit] at com.workingdogs.village.Schema.schema(Schema.java:151)
[junit] at com.workingdogs.village.DataSet.<init>(DataSet.java:153)
[junit] at com.workingdogs.village.TableDataSet.<init>
(TableDataSet.java:133)
[junit] at org.apache.torque.util.BasePeer.processTables
(BasePeer.java:1720)
[junit] at org.apache.torque.util.BasePeer.doDelete
(BasePeer.java:427)
[junit] ... 18 more
[junit]
[junit] Testcase: testSaves
Seems that invoking getMetadata() on a prepared statement that is not
executed is not working in oracle (I am using 10.2.0.2.0). Adding
statement.execute() before querying the metadata seems to fix the problem.
I know this has been in there quite some time and in the meantime I did run
the tests successfully against oracle (I write an email about it), but it
seems I was still using the 3.3.1 village version then :-(
However, even when this is fixed there is a case sensitivity and table
prefix issue in column names: e.g. village knows the column name
author.AUTHOR_ID but the request is for author_id. This results in
exceptions like
org.apache.torque.TorqueException:
com.workingdogs.village.DataSetException: Column name: author_id does not
exist!
at org.apache.torque.util.BasePeer.throwTorqueException
(BasePeer.java:106)
at org.apache.torque.util.BasePeer.insertOrUpdateRecord
(BasePeer.java:668)
at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:563)
at org.apache.torque.test.BaseAuthorPeer.doInsert
(BaseAuthorPeer.java:221)
at org.apache.torque.test.BaseAuthorPeer.doInsert
(BaseAuthorPeer.java:570)
at org.apache.torque.test.BaseAuthor.save(BaseAuthor.java:585)
at org.apache.torque.test.BaseAuthor.save(BaseAuthor.java:549)
at org.apache.torque.test.BaseAuthor.save(BaseAuthor.java:530)
at org.apache.torque.DataTest.testInsertData(DataTest.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:197)
Caused by: com.workingdogs.village.DataSetException: Column name: author_id
does not exist!
at com.workingdogs.village.Schema.index(Schema.java:410)
at com.workingdogs.village.Record.setValue(Record.java:1134)
at org.apache.torque.util.VillageUtils.setVillageValue
(VillageUtils.java:212)
at org.apache.torque.util.BasePeer.insertOrUpdateRecord
(BasePeer.java:663)
... 23 more
Not sure if all test failures are caused by these two problems but they are
the most prominent problems.
Thomas
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]