Hi Martin,
I had the same problem and since nobody else seems to jump on this one,
here is what I did:
The generated SQL is obviously bogus, which is probably more a Torque
issue than one with OJB. I just deleted the "VARCHAR(n) FOR BIT DATA"
parts and executed the SQL manually. Then I proceeded with the Ant target
junit-no-compile-no-prepare which skips the DB preparation. (You have to
run all 3 SQL scripts everytime before running the unit tests, though!)
That way I was left with 2 test failures, one in testDeleteWithRemovalAwareCollection,
and one in the ODGM test suite. The first failure is fixed by a change
to the test case that Armin Waibel checked into CVS some days ago. I don't
know what the reason for the ODGM failure is and I didn't investigate much
further because at the moment I only need the persistence broker API.
(Actually I get ODMG failures also when running against HSQLDB).
Regards,
Gerhard Grosse
Martin Gr�neberg <[EMAIL PROTECTED]>
12.08.2003 10:11
Bitte antworten an "OJB Users List"
An: <[EMAIL PROTECTED]>
Kopie:
Thema: Problems rc4 tests on db2 7.2.5
Hello,
i try to test ojb for my next project. I followed the instructions in
the "get startet" section
but when I build and test ojb1.0rc4 on my system (win2k, jdk1.4.2, ibm
DB2 7.2.5 and the IBM
jdbc-driver) I get SQL Errors and some of the tests fail.
I think the error in the odmg tests happens because of the failed create
of table ojb_dmap_entries.
I don't know if the error in testDeleteWithRemovalAwareCollection has
the same reason.
I'm not an DB2/SQL guru but the statement in
/target/src/sql/ojbcore-schema.sql seems to be wrong
CREATE TABLE OJB_DMAP_ENTRIES
(
ID INTEGER NOT NULL,
DMAP_ID INTEGER NOT NULL,
KEY_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA,
VALUE_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA
);
ALTER TABLE OJB_DMAP_ENTRIES
ADD PRIMARY KEY (ID);
How is the right syntax of the create statement?
I read that this sql is generated by tourque so it makes no sense to
correct it here?
Is there a fix for this problem?
Does this error effect the functionality of the odmg interface?
Thanks for help
Martin Gr�neberg
Here is the output of the test-run: .\bin\build.bat junit
from cmd: build.bat junit
<snip>
[torque-insert-sql] Failed to execute: drop table OJB_DMAP_ENTRIES
[torque-insert-sql] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI
Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein nicht
definierter Name. SQLSTATE=42704
[torque-insert-sql] Failed to execute: CREATE TABLE OJB_DMAP_ENTRIES (
ID INTEGER NOT NULL, DMAP_ID INTEGER NOT NULL, KE
Y_OID VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA, VALUE_OID
VARCHAR(250) FOR BIT DATA VARCHAR(n) FOR BIT DATA )
[torque-insert-sql] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI
Driver][DB2/NT] SQL0104N Auf "AR(250) FOR BIT DATA" folgte
das unerwartete Token "VARCHAR". Zu den m�glichen Token geh�ren:
"REFERENCES". SQLSTATE=42601
[torque-insert-sql] Failed to execute: ALTER TABLE OJB_DMAP_ENTRIES ADD
PRIMARY KEY (ID)
[torque-insert-sql] COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI
Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein
nicht definierter Name. SQLSTATE=42704
[torque-insert-sql] Executing file:
H:\db-ojb-1.0.rc4\target\src\sql\ojbtest-data.sql
[torque-insert-sql] 461 of 464 SQL statements executed successfully
junit-no-compile-no-prepare:
[junit] Running org.apache.ojb.broker.AllTests
[junit] Tests run: 247, Failures: 1, Errors: 0, Time elapsed: 32,578
sec
[junit] TEST org.apache.ojb.broker.AllTests FAILED
[junit] Running org.apache.ojb.odmg.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/H:/db-ojb-1.0.rc4/target/test/ojb/OJB.properties
[junit] Tests run: 160, Failures: 0, Errors: 1, Time elapsed: 11,703
sec
[junit] TEST org.apache.ojb.odmg.AllTests FAILED
[junit] Running org.apache.ojb.soda.AllTests
[junit] [BOOT] INFO: OJB.properties:
file:/H:/db-ojb-1.0.rc4/target/test/ojb/OJB.properties
[junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 1,734
sec
[junit] Running org.apache.ojb.otm.AllTests
[junit] Tests run: 73, Failures: 0, Errors: 0, Time elapsed: 11,453
sec
</snip>
from tests-broker.txt:
<snip>
Testcase: testDeleteWithRemovalAwareCollection took 0,047 sec
FAILED
expected:<1> but was:<0>
junit.framework.AssertionFailedError: expected:<1> but was:<0>
at
org.apache.ojb.broker.OneToManyTest.testDeleteWithRemovalAwareCollection
(OneToManyTest.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
</snip>
from tests-odmg.txt
<snip>
Testcase: testAdding took 0,047 sec
Caused an ERROR
[IBM][CLI Driver][DB2/NT] SQL0204N "MARTIN.OJB_DMAP_ENTRIES" ist ein
nicht definierter Name. SQLSTATE=42704
org.odmg.LockNotGrantedException: [IBM][CLI Driver][DB2/NT] SQL0204N
"MARTIN.OJB_DMAP_ENTRIES" ist ein nicht definierter Name.
SQLSTATE=42704
at
org.apache.ojb.odmg.TransactionImpl.lock(TransactionImpl.java:297)
at
org.apache.ojb.odmg.collections.DMapImpl.put(DMapImpl.java:198)
at
org.apache.ojb.odmg.DMapTest.testAdding(DMapTest.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
</snip>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]