[ http://issues.apache.org/jira/browse/GERONIMO-1046?page=all ]
     
Matt Hogstrom resolved GERONIMO-1046:
-------------------------------------

    Fix Version: 1.0
     Resolution: Fixed

Added new Syntax Factories for Oracle that generate correct SQL for the CASE 
operator.  To use this alternate factory you must add the following options in 
the deployment plan:

<ejb-ql-compiler-factory>org.tranql.ejbcompiler.OracleEJBQLCompilerFactory</ejb-ql-compiler-factory>
<db-syntax-factory>org.tranql.sql.oracle.OracleDBSyntaxFactory</db-syntax-factory>

before the <enterprise beans> tag


> ORA-00920 SQL Exception thrown when testing day trader with Oracle
> ------------------------------------------------------------------
>
>          Key: GERONIMO-1046
>          URL: http://issues.apache.org/jira/browse/GERONIMO-1046
>      Project: Geronimo
>         Type: Bug
>     Versions: 1.0
>  Environment: All
>     Reporter: Matt Hogstrom
>     Assignee: Matt Hogstrom
>      Fix For: 1.0

>
> The following exception occurs when running day trader with Oracle:
> 15:54:36,575 WARN  [/trade] /trade/app: java.rmi.RemoteException: Unable to 
> commit container transaction; nested exception is:
>         javax.transaction.SystemException: Unable to commit container 
> transaction
>         at 
> org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor.java(Compiled
>  Code))
>         at 
> org.openejb.proxy.SessionEJBObject$$EnhancerByCGLIB$$c46b8cb8.login(<generated>)
>         at 
> org.apache.geronimo.samples.daytrader.TradeAction.login(TradeAction.java:421)
>         at 
> org.apache.geronimo.samples.daytrader.web.TradeServletAction.doLogin(TradeServletAction.java:341)
>         at 
> org.apache.geronimo.samples.daytrader.web.TradeAppServlet.performTask(TradeAppServlet.java:124)
>         at 
> org.apache.geronimo.samples.daytrader.web.TradeAppServlet.doPost(TradeAppServlet.java:86)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>         at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
>         at 
> org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolder.java:99)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
>         at 
> org.apache.geronimo.samples.daytrader.web.OrdersAlertFilter.doFilter(OrdersAlertFilter.java:84)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
>         at 
> org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
> onHandler.java:471)
>         at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
> 68)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>         at 
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
> Context.java:635)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>         at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
>         at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
>         at 
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
> 244)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>         at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> Caused by: javax.transaction.SystemException: Unable to commit container 
> transac
> tion
>         at 
> org.apache.geronimo.transaction.context.InheritableTransactionContext
> .rollbackAndThrow(InheritableTransactionContext.java:327)
>         at 
> org.apache.geronimo.transaction.context.InheritableTransactionContext
> .complete(InheritableTransactionContext.java(Compiled Code))
>         at 
> org.apache.geronimo.transaction.context.InheritableTransactionContext
> .commit(InheritableTransactionContext.java(Compiled Code))
>         at 
> org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPo
> licy.java(Compiled Code))
>         at 
> org.openejb.transaction.TransactionContextInterceptor.invoke(Transact
> ionContextInterceptor.java(Compiled Code))
>         at 
> org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionIntercep
> tor.java(Compiled Code))
>         at 
> org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java(Compi
> led Code))
>         ... 27 more
> Caused by: org.tranql.ql.QueryException: Error executing statement: UPDATE 
> Accou
> ntEJB SET creationDate = CASE WHEN ? THEN ? ELSE creationDate END, 
> openBalance =
>  CASE WHEN ? THEN ? ELSE openBalance END, logoutCount = CASE WHEN ? THEN ? 
> ELSE
> logoutCount END, balance = CASE WHEN ? THEN ? ELSE balance END, lastLogin = 
> CASE
>  WHEN ? THEN ? ELSE lastLogin END, loginCount = CASE WHEN ? THEN ? ELSE 
> loginCou
> nt END, profile_userID = CASE WHEN ? THEN ? ELSE profile_userID END WHERE 
> accoun
> tID = ?
>         at 
> org.tranql.sql.jdbc.JDBCUpdateCommand.execute(JDBCUpdateCommand.java(
> Compiled Code))
>         at 
> org.tranql.cache.SimpleFlushStrategy.flush(SimpleFlushStrategy.java(C
> ompiled Code))
>         at 
> org.tranql.cache.SimpleFlushStrategy.flush(SimpleFlushStrategy.java(C
> ompiled Code))
>         at org.tranql.cache.InTxCache.flush(InTxCache.java(Inlined Compiled 
> Code
> ))
>         at 
> org.apache.geronimo.transaction.context.AbstractTransactionContext.fl
> ushState(AbstractTransactionContext.java(Compiled Code))
>         ... 33 more
> Caused by: java.sql.SQLException: ORA-00920: invalid relational operator
>         at 
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
> :124)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java(Compiled 
> Cod
> e))
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java(Inlined 
> Comp
> iled Code))
>         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java(Compiled Code))
>         at 
> oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
> java(Compiled Code))
>         at 
> oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedS
> tatement.java(Compiled Code))
>         at 
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
> nt.java(Compiled Code))
>         at 
> oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep
> aredStatement.java(Compiled Code))
>         at 
> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
> edStatement.java(Compiled Code))
>         at 
> org.tranql.connector.jdbc.PreparedStatementHandle.executeUpdate(Prepa
> redStatementHandle.java(Compiled Code))
>         ... 38 more
> 15:54:36,585 WARN  [ServletHandler] /trade/app:
> java.rmi.RemoteException: Unable to commit container transaction; nested 
> excepti
> on is:
>         javax.transaction.SystemException: Unable to commit container 
> transactio
> n
>         at 
> org.openejb.proxy.EJBMethodInterceptor.intercept(EJBMethodInterceptor
> .java(Compiled Code))
>         at 
> org.openejb.proxy.SessionEJBObject$$EnhancerByCGLIB$$c46b8cb8.login(<
> generated>)
>         at 
> org.apache.geronimo.samples.daytrader.TradeAction.login(TradeAction.j
> ava:421)
>         at 
> org.apache.geronimo.samples.daytrader.web.TradeServletAction.doLogin(
> TradeServletAction.java:341)
>         at 
> org.apache.geronimo.samples.daytrader.web.TradeAppServlet.performTask
> (TradeAppServlet.java:124)
>         at 
> org.apache.geronimo.samples.daytrader.web.TradeAppServlet.doPost(Trad
> eAppServlet.java:86)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:615)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>         at 
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427
> )
>         at 
> org.apache.geronimo.jetty.JettyServletHolder.handle(JettyServletHolde
> r.java:99)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:830)
>         at 
> org.apache.geronimo.samples.daytrader.web.OrdersAlertFilter.doFilter(
> OrdersAlertFilter.java:84)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at 
> org.mortbay.jetty.servlet.JSR154Filter.doFilter(JSR154Filter.java:171
> )
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(
> WebApplicationHandler.java:821)
>         at 
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicati
> onHandler.java:471)
>         at 
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:5
> 68)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1565)
>         at 
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplication
> Context.java:635)
>         at org.mortbay.http.HttpContext.handle(HttpContext.java:1517)
>         at org.mortbay.http.HttpServer.service(HttpServer.java:954)
>         at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
>         at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:983)
>         at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
>         at 
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:
> 244)
>         at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>         at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> Caused by: javax.transaction.SystemException: Unable to commit container 
> transac
> tion
>         at 
> org.apache.geronimo.transaction.context.InheritableTransactionContext
> .rollbackAndThrow(InheritableTransactionContext.java:327)
>         at 
> org.apache.geronimo.transaction.context.InheritableTransactionContext
> .complete(InheritableTransactionContext.java(Compiled Code))
>         at 
> org.apache.geronimo.transaction.context.InheritableTransactionContext
> .commit(InheritableTransactionContext.java(Compiled Code))
>         at 
> org.openejb.transaction.ContainerPolicy$TxRequired.invoke(ContainerPo
> licy.java(Compiled Code))
>         at 
> org.openejb.transaction.TransactionContextInterceptor.invoke(Transact
> ionContextInterceptor.java(Compiled Code))
>         at 
> org.openejb.SystemExceptionInterceptor.invoke(SystemExceptionIntercep
> tor.java(Compiled Code))
>         at 
> org.openejb.GenericEJBContainer.invoke(GenericEJBContainer.java(Compi
> led Code))
>         ... 27 more
> Caused by: org.tranql.ql.QueryException: Error executing statement: UPDATE 
> Accou
> ntEJB SET creationDate = CASE WHEN ? THEN ? ELSE creationDate END, 
> openBalance =
>  CASE WHEN ? THEN ? ELSE openBalance END, logoutCount = CASE WHEN ? THEN ? 
> ELSE
> logoutCount END, balance = CASE WHEN ? THEN ? ELSE balance END, lastLogin = 
> CASE
>  WHEN ? THEN ? ELSE lastLogin END, loginCount = CASE WHEN ? THEN ? ELSE 
> loginCou
> nt END, profile_userID = CASE WHEN ? THEN ? ELSE profile_userID END WHERE 
> accoun
> tID = ?
>         at 
> org.tranql.sql.jdbc.JDBCUpdateCommand.execute(JDBCUpdateCommand.java(
> Compiled Code))
>         at 
> org.tranql.cache.SimpleFlushStrategy.flush(SimpleFlushStrategy.java(C
> ompiled Code))
>         at 
> org.tranql.cache.SimpleFlushStrategy.flush(SimpleFlushStrategy.java(C
> ompiled Code))
>         at org.tranql.cache.InTxCache.flush(InTxCache.java(Inlined Compiled 
> Code
> ))
>         at 
> org.apache.geronimo.transaction.context.AbstractTransactionContext.fl
> ushState(AbstractTransactionContext.java(Compiled Code))
>         ... 33 more
> Caused by: java.sql.SQLException: ORA-00920: invalid relational operator
>         at 
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
> :124)
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java(Compiled 
> Cod
> e))
>         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java(Inlined 
> Comp
> iled Code))
>         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java(Compiled Code))
>         at 
> oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
> java(Compiled Code))
>         at 
> oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedS
> tatement.java(Compiled Code))
>         at 
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
> nt.java(Compiled Code))
>         at 
> oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep
> aredStatement.java(Compiled Code))
>         at 
> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePrepar
> edStatement.java(Compiled Code))
>         at 
> org.tranql.connector.jdbc.PreparedStatementHandle.executeUpdate(Prepa
> redStatementHandle.java(Compiled Code))
>         ... 38 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to