BTW, here is a patch for this problem. It is committed to STABLE
already, and will be committed to HEAD shortly.
Andrus
Index:
src/tests/java/org/objectstyle/cayenne/unit/AbstractAccessStack.java
===================================================================
RCS file:
/cvsroot/cayenne/cayenne/src/tests/java/org/objectstyle/cayenne/unit/
AbstractAccessStack.java,v
retrieving revision 1.7
diff -u -r1.7 AbstractAccessStack.java
---
src/tests/java/org/objectstyle/cayenne/unit/AbstractAccessStack.java 25
Jul 2004 19:28:28 -0000 1.7
+++
src/tests/java/org/objectstyle/cayenne/unit/AbstractAccessStack.java 20
Nov 2004 18:38:24 -0000
..-62,6 +62,7 @@
import java.sql.Statement;
import java.sql.Types;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
..-85,6 +86,12 @@
*/
public abstract class AbstractAccessStack {
private static Logger logObj =
Logger.getLogger(AbstractAccessStack.class);
+
+ // hardcoded dependent entities that should be excluded
+ // if LOBs are not supported
+ private static final String[] EXTRA_EXCLUDED_FOR_NO_LOB = new
String[] {
+ "CLOB_DETAIL"
+ };
protected CayenneTestResources resources;
..-116,12 +123,15 @@
// check for LOB attributes
if (excludeLOB) {
+ if (Arrays.binarySearch(EXTRA_EXCLUDED_FOR_NO_LOB,
ent.getName()) >= 0) {
+ continue;
+ }
+
boolean hasLob = false;
Iterator attrs = ent.getAttributes().iterator();
while (attrs.hasNext()) {
DbAttribute attr = (DbAttribute) attrs.next();
- if (attr.getType() == Types.BLOB
- || attr.getType() == Types.CLOB) {
+ if (attr.getType() == Types.BLOB ||
attr.getType() == Types.CLOB) {
hasLob = true;
break;
}
On Nov 14, 2004, at 9:23 PM, Andrus Adamchik wrote:
> Hi Tore,
>
> I think I vaguely remember seeing this problem (on HSQL?)
>
> You may have noticed that unit tests configuration for each DbAdapter
> is done in a Spring XML file -
> "src/tests/resources/test-resources/spring-test-resources.xml". This
> file allows to map a "unit test adapter" (aka StackAdapter - a
> subclass of org.objectstyle.cayenne.unit.AccessStackAdapter) for a
> DbAdapter. Stack adapter allows to suppress certain tests if a given
> feature is not supported on a target DB, or to configure correct
> schema (e.g. Oracle and Sybase load their own stored procedure
> definitions). I suspect that a certain combination of settings of
> AccessStackAdapter may lead to this error... I can't point out the
> problem right away, but this is the direction to look...
>
> Andrus
>
>
> On Nov 11, 2004, at 7:14 AM, Tore Halset wrote:
>> Hello.
>>
>> I am trying to create a IngresAdapter as we are evaluating Ingres for
>> internal use.
>>
>> The first thing I had to fix was syntax for create statements. "not
>> null" worked, but "null" did not work. I just copied the createTable
>> method from JdbcAdapter and removed two lines.
>>
>> I have also started to do some changes in types.xml, but some more
>> work has to be done.
>>
>> My current problem is with the CLOB_MASTER entity. Running the junit
>> tests fails. The CLOB_DETAIL table are created, but not the
>> CLOB_MASTER. The full log are attached at the bottom of this mail.
>>
>> [java] [junit] INFO QueryLogger: ALTER TABLE CLOB_DETAIL
>> ADD FOREIGN KEY (CLOB_MASTER_ID) REFERENCES CLOB_MASTER
>> (CLOB_MASTER_ID)
>> [java] [junit] ERROR CayenneTestResources: Error generating
>> schema...
>> [java] [junit] ca.gcf.util.SqlEx: Table 'clob_master' does
>> not exist or is not owned by you.
>>
>> Anyone seen this problem before?
>>
>> Regards,
>> - Tore.
>>
>> [java] [junit] INFO QueryLogger: ALTER TABLE CLOB_DETAIL
>> ADD FOREIGN KEY (CLOB_MASTER_ID) REFERENCES CLOB_MASTER
>> (CLOB_MASTER_ID)
>> [java] [junit] ERROR CayenneTestResources: Error generating
>> schema...
>> [java] [junit] ca.gcf.util.SqlEx: Table 'clob_master' does
>> not exist or is not owned by you.
>> [java] [junit] at
>> ca.gcf.jdbc.DrvObj.readError(DrvObj.java:773)
>> [java] [junit] at
>> ca.gcf.jdbc.JdbcStmt.readError(JdbcStmt.java:2259)
>> [java] [junit] at
>> ca.gcf.jdbc.DrvObj.readResults(DrvObj.java:629)
>> [java] [junit] at
>> ca.gcf.jdbc.JdbcStmt.readResults(JdbcStmt.java:2156)
>> [java] [junit] at
>> ca.gcf.jdbc.JdbcStmt.readResults(JdbcStmt.java:2107)
>> [java] [junit] at
>> ca.gcf.jdbc.JdbcStmt.exec(JdbcStmt.java:1364)
>> [java] [junit] at
>> ca.gcf.jdbc.JdbcStmt.execute(JdbcStmt.java:551)
>> [java] [junit] at
>> org.objectstyle.cayenne.unit.AbstractAccessStack.createSchema(Abstract
>> AccessStack.java:289)
>> [java] [junit] at
>> org.objectstyle.cayenne.unit.SimpleAccessStack.createSchema(SimpleAcce
>> ssStack.java:149)
>> [java] [junit] at
>> org.objectstyle.cayenne.unit.CayenneTestResources.rebuildSchema(Cayenn
>> eTestResources.java:185)
>> [java] [junit] at
>> org.objectstyle.cayenne.unit.CayenneTestResources.<clinit>(CayenneTest
>> Resources.java:143)
>> [java] [junit] at java.lang.Class.forName0(Native Method)
>> [java] [junit] at java.lang.Class.forName(Class.java:141)
>> [java] [junit] at
>> org.objectstyle.cayenne.unit.CayenneTestCase.class$(CayenneTestCase.ja
>> va:93)
>>
This archive was generated by hypermail 2.0.0 : Sat Nov 20 2004 - 14:12:23 EST