db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Malakov" <a...@transdecisions.com>
Subject Another issue
Date Tue, 06 Jan 2004 01:59:36 GMT
Hello Armin at all,

I use Oracle 9i and OJB_BRANCH_1_0. What do you guys think about the following problem (I
will describe it step-by-step):

ReportQueryRsIterator uses ResultSetMetaData to determine column types (cannot not use class
registry as others).

Oracle maps INTEGER, INT, SMALLINT to NUMBER(38) datatype (JDBC: java.sql.Types.NUMBER)

ReportQueryRsIterator uses JdbcTypesHelper and maps java.sql.Types.NUMBER into JdbcTypesHelper.T_Numeric
data handler.

JdbcTypesHelper.T_Numeric.readValueFromStatement() will produce java.lang.BigDecimal.

Problem is: java.lang.BigDecimal and java.lang.Integer have different hash code algothims
(1.4.2_02)- hash code values will be different even for the same internal values.

Side effect: MtoNCollectionPrefetcher.associateBatched(Collection owners, Collection children,
Collection mToNImplementors) fails because it tries to match Identity that uses java.lang.BigDecimal
PKs with Identity that uses java.lang.Integer PKs.

User-visible result: NullPointerException during complex object retrieval in line: list.add(child);

RC5 and previous build that I got about two weeks ago didn't had this problem.

Thanks a lot,
Andy
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message