1 Reply Latest reply: Sep 10, 2012 8:52 AM by Cdelahun-Oracle RSS

    StackOverFlowError with Expression query

    amehta5
      We have an Expression query that will generate a query with 1500 to 2000 OR conditions based on some user input. The query does not return more than 2000 rows.

      We sometimes get a StackOverFlowError when the query is executed.
      We notice that the log has a call to printSQL multiple times -
      at oracle.toplink.internal.expressions.CompoundExpression.printSQL(CompoundExpression.java:216)
           at oracle.toplink.expressions.ExpressionOperator.printDuo(ExpressionOperator.java:1669)
      Any idea what is going on? Is there a limit on the SQL generated by Expression Query?
      Thanks for the help.

      LOG -
      java.lang.StackOverflowError
           at oracle.toplink.expressions.ExpressionOperator.printDuo(ExpressionOperator.java:1669)
           at oracle.toplink.internal.expressions.CompoundExpression.printSQL(CompoundExpression.java:216)
           at oracle.toplink.expressions.ExpressionOperator.printDuo(ExpressionOperator.java:1669)
           at oracle.toplink.internal.expressions.CompoundExpression.printSQL(CompoundExpression.java:216)
           at oracle.toplink.expressions.ExpressionOperator.printDuo(ExpressionOperator.java:1669)
      .
      .
      +. _(The above lines keep repeating multiple times)_+
      .
      .
           at oracle.toplink.internal.expressions.ExpressionSQLPrinter.translateExpression(ExpressionSQLPrinter.java:238)
           at oracle.toplink.internal.expressions.ExpressionSQLPrinter.printExpression(ExpressionSQLPrinter.java:106)
           at oracle.toplink.internal.expressions.SQLSelectStatement.printSQL(SQLSelectStatement.java:1199)
           at oracle.toplink.internal.expressions.SQLSelectStatement.buildCall(SQLSelectStatement.java:624)
           at oracle.toplink.publicinterface.Descriptor.buildCallFromStatement(Descriptor.java:558)
           at oracle.toplink.descriptors.ClassDescriptor.buildCallFromStatement(ClassDescriptor.java:191)
           at oracle.toplink.internal.queryframework.StatementQueryMechanism.setCallFromStatement(StatementQueryMechanism.java:381)
           at oracle.toplink.internal.queryframework.StatementQueryMechanism.prepareSelectAllRows(StatementQueryMechanism.java:307)
           at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.prepareSelectAllRows(ExpressionQueryMechanism.java:685)
           at oracle.toplink.queryframework.ReadAllQuery.prepareSelectAllRows(ReadAllQuery.java:699)
           at oracle.toplink.queryframework.ReadAllQuery.prepare(ReadAllQuery.java:666)
           at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(DatabaseQuery.java:405)
           at oracle.toplink.queryframework.ObjectLevelReadQuery.checkPrepare(ObjectLevelReadQuery.java:554)
           at oracle.toplink.queryframework.DatabaseQuery.checkPrepare(DatabaseQuery.java:375)
           at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:598)
           at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:781)
           at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:451)
           at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2089)
           at oracle.toplink.publicinterface.Session.executeQuery(Session.java:993)
           at oracle.toplink.publicinterface.Session.executeQuery(Session.java:950)