jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • castor
  • CASTOR-1961

NumberFormatException: For input string: "10g"

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1.1
  • Fix Version/s: 1.3 rc1
  • Component/s: JDO
  • Labels:
    None
  • Environment:
    Windows XP, JDK 1.5, Oracle 10g

Description

By using of LIMIT clause check castor the Oracle version. castor expected version like a number, but Oracle 10g returns "10g" version which is a cause of following exception:

java.lang.NumberFormatException: For input string: "10g"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.exolab.castor.jdo.DbMetaInfo.compareVersionStrings(DbMetaInfo.java:158)
at org.exolab.castor.jdo.DbMetaInfo.compareDbVersion(DbMetaInfo.java:143)
at org.exolab.castor.jdo.drivers.OracleQueryExpression.isLimitClauseSupported(OracleQueryExpression.java:197)
at org.exolab.castor.jdo.drivers.JDBCQueryExpression.addLimitClause(JDBCQueryExpression.java:282)
at org.exolab.castor.jdo.oql.ParseTreeWalker.addLimitClause(ParseTreeWalker.java:1160)
at org.exolab.castor.jdo.oql.ParseTreeWalker.createQueryExpression(ParseTreeWalker.java:952)

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    castor-oracle-10g-limit.patch
    13/Nov/07 3:02 PM
    3 kB
    Martin Fuchs

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Martin Fuchs added a comment - 13/Nov/07 3:02 PM

The attached patch fixes recognition of Oracle 10g databases in the class DbMetaInfo. It is implemented by searching for the word "Release" in the full database version string and taking the following number expression. Als fallback solution the old algorithm, which just looks for the first numeric word, is also preserved.

I also inserted two examples of real Oracle product names, like they are returned by the JDBC driver, for better understanding of the algorithm and its problems.

Show
Martin Fuchs added a comment - 13/Nov/07 3:02 PM The attached patch fixes recognition of Oracle 10g databases in the class DbMetaInfo. It is implemented by searching for the word "Release" in the full database version string and taking the following number expression. Als fallback solution the old algorithm, which just looks for the first numeric word, is also preserved. I also inserted two examples of real Oracle product names, like they are returned by the JDBC driver, for better understanding of the algorithm and its problems.
Hide
Permalink
Ralf Joachim added a comment - 20/Nov/07 6:18 AM

Patch of Martin looks good. Will try to include the patch for 1.2.

Show
Ralf Joachim added a comment - 20/Nov/07 6:18 AM Patch of Martin looks good. Will try to include the patch for 1.2.
Hide
Permalink
Ralf Joachim added a comment - 12/Apr/08 1:01 PM

Commited patch as is

Show
Ralf Joachim added a comment - 12/Apr/08 1:01 PM Commited patch as is

People

  • Assignee:
    Ralf Joachim
    Reporter:
    Radovana Straube
Vote (0)
Watch (2)

Dates

  • Created:
    04/May/07 7:35 AM
    Updated:
    24/Jan/09 11:15 AM
    Resolved:
    12/Apr/08 1:01 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.