turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Finkelstein <dan.finkelst...@bluescope.com>
Subject RE: Torque: Oracle with idMethod as "native"
Date Thu, 11 Oct 2001 16:19:41 GMT
Thanks for the suggestion.  I just tried this.  It turns out that in the
latest torque, "sequence" has been deprecated and seems to just map to
"native", so either setting produces the same error.  I suspect that it is
something that broke in the more recent development...
Dan

-----Original Message-----
From: Esposito, Paul [mailto:Paul.Esposito@divine.com]
Sent: Wednesday, October 10, 2001 9:02 PM
To: turbine-user@jakarta.apache.org
Subject: RE: Torque: Oracle with idMethod as "native"


Dan,
 
I'm definitely not using the latest torque, so I don't know if my case is
the same as yours, but I had to use sequence instead of native.
 
Hope it helps
 
Paul

-----Original Message----- 
From: Dan Finkelstein 
Sent: Wed 10/10/2001 6:10 PM 
To: 'turbine-user@jakarta.apache.org' 
Cc: 
Subject: Torque: Oracle with idMethod as "native"



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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message