turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Finkelstein <dan.finkelst...@bluescope.com>
Subject Torque: Oracle with idMethod as "native"
Date Wed, 10 Oct 2001 23:10:54 GMT
Hi --

I'm setting up a development using Torque (without Turbine) connected to
Oracle.  Using Steve Davis's "detailed example (long)" (Thanks, Steve!!!!),
I got finished...so I thought!  Then I changed the idbroker to "native" to
test out an insert.  I modified the schema file as shown:

	<database defaultIdMethod="native">

The sql that torque generated looked fine -- the create sequence code was
included.  When I ran my test program, which tried to do an insert, the
following error came up:

	java.sql.SQLException: ORA-00923: FROM keyword not found where
expected

I investigated and found that the framework was tried to call oracle with

	select null.nextval from dual

instead of

	select company_seq.nextval from dual

This has really stumped me.  I'm using the latest jakarta-turbine-torque
from cvs.  Below are some more details.  Any ideas?
Dan

===============================
SHELL LINES
===============================
D:\projects\par>java PLTest
id_in_sql...select null.nextval from dual
java.sql.SQLException: ORA-00923: FROM keyword not found where expected

        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
        at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1503)
        at
oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:
5)
        at
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.j
a:1600)
        at
oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1
8)
        at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleState
nt.java:1805)
        at
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.jav
410)
        at
com.workingdogs.village.QueryDataSet.<init>(QueryDataSet.java:112)
        at
org.apache.torque.oid.SequenceIdGenerator.getIdAsVillageValue(Seque
eIdGenerator.java:189)
        at
org.apache.torque.oid.SequenceIdGenerator.getIdAsBigDecimal(Sequenc
dGenerator.java:126)
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:791)
        at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:695)
        at
com.bluescope.pl.tables.BaseCompanyPeer.doInsert(BaseCompanyPeer.ja
:126)
        at
com.bluescope.pl.tables.BaseCompanyPeer.doInsert(BaseCompanyPeer.ja
:112)
        at
com.bluescope.pl.tables.BaseCompanyPeer.doInsert(BaseCompanyPeer.ja
:344)
        at PLTest.main(PLTest.java:26)

D:\projects\par>

===============================
PART OF MY SCHEMA XML FILE
===============================
<database
	defaultIdMethod="native"
>

<table name="COMPANY">
    <column name="ID" required="true" autoIncrement="true"
            primaryKey="true" type="INTEGER"/>
    <column name="NAME" required="true" size="255" type="VARCHAR"/>
    <column name="GLOBALXML" required="true" size="255" type="VARCHAR"/>
    <column name="UPDATED" required="true" type="TIMESTAMP"/>
  </table>

===============================
PART OF MY JAVA TEST PROGRAM
===============================
	// initialize Torque
	Torque.init("/projects/par/par.properties");

	Company c = new Company();
	c.setName ("IBM");
	c.setGlobalxml ("abcxml");
	c.setUpdated(new Date());
	CompanyPeer.doInsert (c);

===============================
PART OF MY PROPERTIES FILE
===============================
services.DatabaseService.database.default=default

services.DatabaseService.database.default.driver=oracle.jdbc.driver.OracleDr
iver
services.DatabaseService.database.default.url=jdbc:oracle:oci8:@DBBOX
services.DatabaseService.database.default.username=xxx
services.DatabaseService.database.default.password=xxx

services.DatabaseService.database.adapter=DBOracle
services.DatabaseService.database.adapter.DBOracle=oracle.jdbc.driver.Oracle
Driver

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Mime
View raw message