db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Error while using oracle.
Date Tue, 29 Mar 2005 07:36:29 GMT




Hi,

The null comes in from where the method is called:

    public String getIDMethodSQL(Object sequenceName)
    {
        return ("select " + sequenceName + ".nextval from dual");
    }

It seems that in CVS version, the method where it is called from is
IdGenerator.getIdAsXXX(), but I have not found any references to these
functions.
Can you put a breakpoint to the getIDMethodSQL, and send the stack trace
from that position ? I'm most interested in where the
IdGenerator.getIdAsXXX() is called from.

By the way, which Torque version are you using ?

   Thomas

Sriram Puvvada <spuvvada@comergent.com> schrieb am 21.03.2005 16:17:37:

> Hi all,
>
>             We are using torque for almost 2 years. Our application DB is
MS
> SQL Server and now we are migrating into Oracle. In MS SQL Sever we used
all
> of our table's primary keys is Identity column so we used Sequences and
Pre
> Insert Triggers in Oracle. When we tried to insert data into tables we
are
> getting the following error
>
>
>
> java.sql.SQLException: ORA-00923: FROM keyword not found where expected
>
>             at
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
>
>             at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
>
>             at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
>
>             at
oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
>
>             at
> oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:830)
>
>             at
>
oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2391)

>
>             at
>
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java

> :2672)
>
>             at
> oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:572)
>
>             at com.workingdogs.village.QueryDataSet.<init>(Unknown
Source)
>
>             at
>
org.apache.torque.oid.SequenceIdGenerator.getIdAsVillageValue(SequenceIdGene

> rator.java:195)
>
>             at
>
org.apache.torque.oid.SequenceIdGenerator.getIdAsBigDecimal(SequenceIdGenera

> tor.java:132)
>
>             at
org.apache.torque.util.BasePeer.doInsert(BasePeer.java:702)
>
>             at
>
com.profile.prosaim.om.BaseAuditTrailPeer.doInsert(BaseAuditTrailPeer.java:2

> 28)
>
>             at
>
com.profile.prosaim.om.BaseAuditTrailPeer.doInsert(BaseAuditTrailPeer.java:5

> 87)
>
>             at
> com.profile.prosaim.om.BaseAuditTrail.save(BaseAuditTrail.java:622)
>
>             at
> com.profile.prosaim.om.BaseAuditTrail.save(BaseAuditTrail.java:584)
>
>             at
> com.profile.prosaim.om.BaseAuditTrail.save(BaseAuditTrail.java:564)
>
>             at
> com.profile.prosaim.web.util.RunData.performLogin(RunData.java:651)
>
>             at com.profile.prosaim.web.Login.doGet(Login.java:131)
>
>             at
> com.profile.prosaim.web.WebApplication.doPost(WebApplication.java:172)
>
>             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>
>             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>             at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
>
>             at
> jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
>
>             at
> jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
>
>             at
> jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
>
>             at
> jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
>
>             at
>
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451

> )
>
>             at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
>
> Put on debug using torque source we found that
>
> In class DBOracle the following method was returing null for sequence
which
> was throwing the error.
>
>
>
>     public String getIDMethodSQL(Object sequenceName)
>
>     {
>
>         return ("select " + sequenceName + ".nextval from dual");
>
>     }
>
>
>
> Any help in solving this issue will be greatly appreciated
>
>
>
> Sriram..
>
>
>


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


Mime
View raw message