db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hay, Markus" <markus....@secureinfo.com>
Subject Error using Oracle + Torque 3.1 (ORA-00923)
Date Thu, 09 Mar 2006 22:55:22 GMT
Hello.

We're using Torque 3.1 with our application and the following
TorqueException is being thrown when we are importing application
content into the database (note that everything works fine when using
MSSQL):

[Stack_Trace] = 
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:236)
org.apache.torque.util.BasePeer.doInsert(BasePeer.java:730)
com.secureinfo.flatties.om.BaseImagePeer.doInsert(BaseImagePeer.java:239
)
com.secureinfo.flatties.om.BaseImagePeer.doInsert(BaseImagePeer.java:601
)
com.secureinfo.flatties.om.BaseImage.save(BaseImage.java:644)
com.secureinfo.baboon.export.db.ObjectInjector.injectPrimaryObject(Objec
tInjector.java:628)
com.secureinfo.baboon.export.db.ObjectInjector.inject(ObjectInjector.jav
a:390)
com.secureinfo.baboon.export.xml.DBImporter.importXML(DBImporter.java:45
0)
com.secureinfo.baboon.export.xml.DBImporter.injectClasses(DBImporter.jav
a:337)
com.secureinfo.baboon.export.xml.DBImporter.runImport(DBImporter.java:24
7)
com.secureinfo.baboon.export.ui.ContentAdminFramework.performImport(Cont
entAdminFramework.java:596)
com.secureinfo.baboon.export.ui.ContentAdminFramework.prepImport(Content
AdminFramework.java:525)
com.secureinfo.baboon.export.ui.ContentAdminFramework.locateData(Content
AdminFramework.java:298)
com.secureinfo.baboon.export.ui.ContentAdminFramework.postTaskConfig(Con
tentAdminFramework.java:247)
com.secureinfo.baboon.export.ui.ContentAdminFramework.doRun(ContentAdmin
Framework.java:175)
com.secureinfo.baboon.export.ui.ContentAdminFramework.run(ContentAdminFr
amework.java:114)
com.secureinfo.baboon.export.ui.DBMain.invoke(DBMain.java:157)
com.secureinfo.baboon.export.ui.DBMain.main(DBMain.java:262)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
BootStrapContent.main(BootStrapContent.java:54)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.zerog.lax.LAX.launch(DashoA8113)
com.zerog.lax.LAX.main(DashoA8113)
org.apache.torque.TorqueException: ORA-00923: FROM keyword not found
where expected


** The following is what we are using in our Torque XML file that
generates the classes (for the particluar table that is causing the
above error):
<table name="IMAGE" idMethod="native">
        <column primaryKey="true" required="true" type="INTEGER"
name="IMAGE_ID"/>
        <column type="BINARY" name="DATA"/>
        <column type="DATE" name="MODIFIED_DATE"/>
        <column type="VARCHAR" name="MODIFIED_USER_NAME"/>
        <column type="VARCHAR" name="MODIFIED_DOMAIN_NAME"/>
        <column type="INTEGER" javaType="object" name="FLAVOR_ID"/>
        <column type="VARCHAR" name="GUID"/>
        <column type="BIT" javaType="object" name="DEPRECATED"/>
        <column type="INTEGER" javaType="object" name="DEPRECATED_BY"/>
        <column type="CHAR" name="image_hash"/>
        <column type="VARCHAR" name="image_name"/>
</table>

** The table is created as follows (through various scripts during the
installation process):
CREATE TABLE IMAGE (
	IMAGE_ID INT NOT NULL,
	DATA BLOB NULL,
	MODIFIED_DATE TIMESTAMP NULL,
	MODIFIED_USER_NAME VARCHAR2 (50) NULL,
	MODIFIED_DOMAIN_NAME VARCHAR2 (50) NULL,
	FLAVOR_ID INT NULL,
	GUID VARCHAR2 (256) NULL,
	DEPRECATED SMALLINT NULL,
	DEPRECATED_BY INT NULL,
	image_hash	char(32) null,
	image_name	varchar(50) null
)

ALTER TABLE IMAGE ADD CONSTRAINT XK_IMAGE PRIMARY KEY  (IMAGE_ID);

CREATE SEQUENCE SEQ_IMAGE START WITH 1 INCREMENT BY 1;

CREATE OR REPLACE TRIGGER IMAGE_IDENTITY
BEFORE INSERT ON "IMAGE" FOR EACH ROW
BEGIN
  IF :NEW.IMAGE_ID IS NULL THEN
    SELECT NVL(:NEW.IMAGE_ID, SEQ_IMAGE.NEXTVAL)
    INTO   :NEW.IMAGE_ID
    FROM   DUAL;
  END IF;
END;

--------

Does anyone know what the problem is and how I might fix it? I've
searched around but haven't run into a solution for this. Is this an
issue with Torque or does something need to change on our end? Thanks in
advance.

Markus F. Hay
Configuration Manager

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message