Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using null values in CMP fields of Numeric data type

3 views
Skip to first unread message

Ignacio

unread,
Feb 12, 2003, 7:20:29 AM2/12/03
to

Hi,

This is a question more than an answer. What data type are you using for those
CMP fields? I suggest you should be using non-primitive data types. For example,
java.lang.Long or java.lang.Integer instead of int or long. This way you would
avoid problems with null values and others.

Hope this help

Srinivas konathala <srinivas....@etc.co.uk> wrote:
>Is there any undocumented restriction on allowing Oracle SQL Null values
>in numeric CMP fields. Recently, I have come across a situation where
>the container thrown an exception when retrieving integer values from
>the CMP Bean for two such CMP fields. As per J2EE Spec on CMP contract,
>the container is responsoble for implementing the JDBC code and doing
>necessary data type convesrion. So, I expected the container implementation
>to check for null values and return apropraite values.

Srinivas konathala

unread,
Feb 12, 2003, 6:47:49 AM2/12/03
to

Rob Woollen

unread,
Feb 12, 2003, 1:23:38 PM2/12/03
to
Can you show us the exception / stack trace etc? THis should work, but
we can't help you without more information.

-- Rob

Ken

unread,
Mar 7, 2003, 2:14:17 PM3/7/03
to

I'll supply mine!

This stack trace occurs on WLS6.1SP4 using the Oracle drivers supplied by Bea.
The EJB member data elements are defined as the Java wrapper types.


java.sql.SQLException: java.lang.NullPointerException
at java.lang.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:981)
at java.lang.Double.valueOf(Double.java:163)
at oracle.sql.NUMBER.toDouble(NUMBER.java:326)
at oracle.jdbc.dbaccess.DBConversion.NumberBytesToDouble(DBConversion.java:2975)
at oracle.jdbc.driver.OracleStatement.getDoubleValue(OracleStatement.java:4485)
at oracle.jdbc.driver.OracleResultSetImpl.getDouble(OracleResultSetImpl.java:567)
at weblogic.jdbc.jts.ResultSet.getDouble(ResultSet.java:183)
at weblogic.jdbc.rmi.internal.ResultSetImpl.getDouble(ResultSetImpl.java:232)
at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getDouble(ResultSetStraightReader.java:72)
at weblogic.jdbc.rmi.SerialResultSet.getDouble(SerialResultSet.java:234)
at com.xxx_v41ane__WebLogic_CMP_RDBMS.ejbFindByPrimaryKey(xxx_v41ane__WebLogic_CMP_RDBMS.java:1429)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.findByPrimaryKey(RDBMSPersistenceManager.java:167)
at weblogic.ejb20.manager.BaseEntityManager.findByPrimaryKey(BaseEntityManager.java:430)
at weblogic.ejb20.manager.BaseEntityManager.localFindByPrimaryKey(BaseEntityManager.java:390)
at weblogic.ejb20.internal.EntityEJBLocalHome.findByPrimaryKey(EntityEJBLocalHome.java:261)
at com.xxx_v41ane_LocalHomeImpl.findByPrimaryKey(xxx_v41ane_LocalHomeImpl.java:111)
at com.xxx.ejbLoad(Unknown Source)
.....

0 new messages