glassfish
  1. glassfish
  2. GLASSFISH-381

Sybase : Avg on a column mapped to a datatype INTEGER currently does not yield any results

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

    • Issuezilla Id:
      381

      Description

      My following test which does an AVG(INTEGERDATA) query does not return any
      data. When I checked the database, the data is present with the following
      information.

      1> select INTEGERDATA from DATATYPES
      2> go
      INTEGERDATA
      -----------
      2147483647
      0

      (2 rows affected)
      1> select AVG(INTEGERDATA) from DATATYPES
      2> go
      -----------
      1073741823

      (1 row affected)
      1>

      where as my query returns the following

      Caused by: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 10g release 4
      (10.1.4.0.0) (Build 060216Dev)):
      oracle.toplink.essentials.exceptions.DatabaseException
      Internal Exception: java.sql.SQLException: [sun][Sybase JDBC Driver]No
      ResultSet set was produced.Error Code: 0

      Call:SELECT AVG(INTEGERDATA) FROM DATATYPES

      -----------------------------

      > Hi Sailaja,
      >
      > Can you reproduce the issue using sybase native driver?
      >
      > Thanks,
      > Mitesh

      -----------------------

      Hi Mitesh,

      I did try it with Jconnect and it still fails.

      [TopLink Warning]: 2006.03.08 06:08:32.421-UnitOfWork(22764392)-Exception
      [TOPLINK-4002] (Oracle TopLink Essentials - 10g release 4 (10.1.4.0.0) (Build
      060216Dev)): oracle.toplink.essentials.exceptions.DatabaseException

      Internal Exception: java.sql.SQLException: JZ0R2: No result set for this
      query.Error Code: 0

      Call:SELECT AVG(INTEGERDATA) FROM DATATYPES

      Query:ReportQuery(ejb30.persistence.datatypes.ejb.DataTypes)

      Thanks,
      Sailaja

      --------------------------

      Hi Sailaja,

      I did a quick search on the error code and found following (from
      http://www.sybase.com/detail?id=1009774)

      • Some /MetaData/ methods may fail with JZ0R2 or other errors if you
        execute them on a connection while in an extended transaction.
      • You cannot use the following /DatabaseMetaData/ methods on a
        connection while the connection is in a transaction (in other
        words, if setAutoCommit() is set to false and you perform a
        select, insert, update, delete, or *execute *command; or
        if you perform an explicit begin transaction command):
      • getColumns()
      • getColumnPrivileges()
      • getCrossReference()
      • getIndexInfo()
      • getExportedKeys()
      • getImportedKeys()
      • getPrimaryKeys()

      Looks like you might have hit a bug in Sybase. We need more investigation. Go
      ahead and file an issue in issuetracker

      Thanks,
      Mitesh

        Activity

        Hide
        marina vatkina added a comment -

        ...

        Show
        marina vatkina added a comment - ...
        Hide
        Mitesh Meswani added a comment -

        Reassigning to Markus

        Show
        Mitesh Meswani added a comment - Reassigning to Markus
        Hide
        mf125085 added a comment -

        Starting the investigation.

        Show
        mf125085 added a comment - Starting the investigation.
        Hide
        mf125085 added a comment -

        Created an attachment (id=148)
        testcase

        Show
        mf125085 added a comment - Created an attachment (id=148) testcase
        Hide
        mf125085 added a comment -

        Hi Sailaja,

        this issue works for me, I'm running out-of-container. I created an attachment.

        To run the testcase:

        • create the DATATYPES table
        • edit runtest.sh to point to your gf installation
        • ./runtest.sh

        – markus.

        Show
        mf125085 added a comment - Hi Sailaja, this issue works for me, I'm running out-of-container. I created an attachment. To run the testcase: create the DATATYPES table edit runtest.sh to point to your gf installation ./runtest.sh – markus.
        Hide
        mf125085 added a comment -

        Failure in original test case is reproducable and still occurs.

        Show
        mf125085 added a comment - Failure in original test case is reproducable and still occurs.
        Hide
        mf125085 added a comment -

        Created an attachment (id=168)
        JDBC test reproducing the error; this is a database bug

        Show
        mf125085 added a comment - Created an attachment (id=168) JDBC test reproducing the error; this is a database bug
        Hide
        mf125085 added a comment -

        This is a database issue. Due to the test data, AVG(INTEGERDATA) produces an
        arithmetic overflow, please see attachment avg_overflow_test.zip.

        Show
        mf125085 added a comment - This is a database issue. Due to the test data, AVG(INTEGERDATA) produces an arithmetic overflow, please see attachment avg_overflow_test.zip.

          People

          • Assignee:
            mf125085
            Reporter:
            sailajar
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: