We are running into a strange error. We are receiving a "ORA-00933: SQL command not properly ended" exception only when we are using Oracle 8 using a jndi data source and creating a query that does a join. The following is a code example: Criteria criteria = new Criteria(); criteria.addEqualToField(IFoundationViewToMenu.MENUNDX,"menu.ndx"); criteria.addNotEqualTo(IFoundationViewToMenu.VIEWNDX, new Integer(allKey)); Query query = QueryFactory.newQuery(IFoundationViewToMenu.class, criteria);
Collection results = broker.getCollectionByQuery(query); See the end of this email for the database and repository stuff... This exact code works just fine on: - MS SQL Server using a data source - MS SQL Server not using a data source - Oracle not using a data source So what is the SQL being generated? Don't know - can't get any OJB output even when setting things to DEBUG in the OJB.properties file and we have never been able to get spy to work for us. Is there something like the SQL Server Enterprise Manager "SQL Profiler" tool for Oracle anywhere? That would show the actual SQL coming to the DB. Anyway, we are using OJB RC3 - the exact iteration I have long forgotten. We got this one from the CVS head around April 24. We have run our app on Tomcat 4.1.x, Websphere 4 & 5, and JRun 4. Any ideas on this one? The only solution we thought of would be for us to send OJB the hard coded SQL for the join but that is something I really really really do not want to do. The OJB database connection stuff: <jdbc-connection-descriptor jcd-alias="default" default-connection="true" jdbc-level="2.0" jndi-datasource-name="java:comp/env/jdbc/flFactoryDS" batch-mode="false" useAutoCommit="0" > <sequence-manager className="com.factorylogic.common.persistence.ojb.SequenceManagerDummy"/> </jdbc-connection-descriptor> The relevant repository table mappings: <class-descriptor table="flFoundationViewToMenu" class="com.factorylogic.streamline.persistence.om.FoundationViewToMenu" > <field-descriptor id="1" name="ndx" column="ndx" jdbc-type="INTEGER" nullable="false" primarykey="true" autoincrement="true" /> <field-descriptor id="2" name="dateCreated" column="dateCreated" jdbc-type="TIMESTAMP" nullable="false" /> <field-descriptor id="3" name="dateModified" column="dateModified" jdbc-type="TIMESTAMP" /> <field-descriptor id="4" name="dateDeleted" column="dateDeleted" jdbc-type="TIMESTAMP" /> <field-descriptor id="5" name="viewNdx" column="viewNdx" jdbc-type="INTEGER" nullable="false" conversion="org.apache.ojb.broker.accesslayer.conversions.Int2IntegerFieldCo nversion" /> <field-descriptor id="6" name="menuNdx" column="menuNdx" jdbc-type="INTEGER" nullable="false" conversion="org.apache.ojb.broker.accesslayer.conversions.Int2IntegerFieldCo nversion" /> <reference-descriptor name="view" class-ref="com.factorylogic.streamline.persistence.om.FoundationView" auto-retrieve="false"> <foreignkey field-ref="viewNdx"/> </reference-descriptor> <reference-descriptor name="menu" class-ref="com.factorylogic.streamline.persistence.om.FoundationMenu" auto-retrieve="false"> <foreignkey field-ref="menuNdx"/> </reference-descriptor> </class-descriptor> <class-descriptor class="com.factorylogic.streamline.persistence.interfaces.IFoundationViewToM enu"> <extent-class class-ref="com.factorylogic.streamline.persistence.om.FoundationViewToMenu"/ > </class-descriptor> <!------------------------------------------------------------- --> <class-descriptor table="flFoundationMenu" class="com.factorylogic.streamline.persistence.om.FoundationMenu" > <field-descriptor id="1" name="ndx" column="ndx" jdbc-type="INTEGER" nullable="false" primarykey="true" autoincrement="true" /> <field-descriptor id="2" name="dateCreated" column="dateCreated" jdbc-type="TIMESTAMP" nullable="false" /> <field-descriptor id="3" name="dateModified" column="dateModified" jdbc-type="TIMESTAMP" /> <field-descriptor id="4" name="dateDeleted" column="dateDeleted" jdbc-type="TIMESTAMP" /> <field-descriptor id="5" name="mainMenuPriority" column="mainMenuPriority" jdbc-type="INTEGER" nullable="false" /> <field-descriptor id="6" name="subMenuPriority" column="subMenuPriority" jdbc-type="INTEGER" nullable="false" /> <field-descriptor id="7" name="dropDownMenuPriority" column="dropDownMenuPriority" jdbc-type="INTEGER" nullable="false" /> <field-descriptor id="8" name="url" column="url" jdbc-type="VARCHAR" nullable="false" conversion="com.factorylogic.streamline.common.util.ojb.BlankString2OneSpace StringConversion" /> <field-descriptor id="9" name="turnedOn" column="turnedOn" jdbc-type="INTEGER" nullable="false" /> </class-descriptor> <class-descriptor class="com.factorylogic.streamline.persistence.interfaces.IFoundationMenu"> <extent-class class-ref="com.factorylogic.streamline.persistence.om.FoundationMenu"/> </class-descriptor> +---------------------------------------------------------+ This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. +---------------------------------------------------------+