Number Overflow when it is within the range (Long)
186589Mar 5 2003 — edited Mar 6 2003Hi,
I am using Oracle JDBC Drivers to write a CMP (Container Managed Persistance) beans which has a CMP Field of long value in
the table it is Number(14) which is well under the limits of long datatype, the value is also currentmillis which is millis
from 1-1-1970, the value is also 1046836194640L which is withing long datatypes limits but gives the overflow exception,
please help me with the same. try to use the oracle.sql.NUMBER.toLong which expects a byte[] on the value it gives an error.
simple way to test this is get the above value from dual table get the rs.getBytes and take the byte[] and pass it to the
oracle.sql.NUMBER.toLong it will give the error. and one more strange observation i found is when this number is stored in the table and you try to just perform a select in SQL Query Manager or SQLPlus in windows 2000 you will receive an windows Excepton telling that program tried to refer to memeory outside and you have to quit the client app.
Database is oracle 8i on windows 2000 advanced Server
Expired Commands Not Found javax.ejb.FinderException: Exception in 'findExpiredCommandsOfThisMaster' while using result set:
'weblogic.jdbc.rmi.SerialResultSet@7d78ce'
java.sql.SQLException: Overflow Exception
java.sql.SQLException: Overflow Exception
at oracle.sql.NUMBER.toLong(NUMBER.java:371)
at oracle.jdbc.dbaccess.DBConversion.NumberBytesToLong(DBConversion.java:2915)
at oracle.jdbc.driver.OracleStatement.getLongValue(OracleStatement.java:4373)
at oracle.jdbc.driver.OracleResultSetImpl.getLong(OracleResultSetImpl.java:529)
at weblogic.jdbc.pool.ResultSet.getLong(ResultSet.java:107)
at weblogic.jdbc.rmi.internal.ResultSetImpl.getLong(ResultSetImpl.java:216)
at weblogic.jdbc.rmi.internal.ResultSetStraightReader.getLong(ResultSetStraightReader.java:62)
at weblogic.jdbc.rmi.SerialResultSet.getLong(SerialResultSet.java:204)
at
net.devicesWorld.deviceServer.server.device.command.InstructionalUnit_7krj5v__WebLogic_CMP_RDBMS.ejbFindExpiredCommandsOfThis
Master(Instruc
tionalUnit_7krj5v__WebLogic_CMP_RDBMS.java:1877)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:278)
at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:670)
at weblogic.ejb20.manager.BaseEntityManager.collectionFinder(BaseEntityManager.java:643)
at weblogic.ejb20.internal.EntityEJBHome.finder(EntityEJBHome.java:448)
at
net.devicesWorld.deviceServer.server.device.command.InstructionalUnit_7krj5v_HomeImpl.findExpiredCommandsOfThisMaster(Instruc
tionalUnit_7kr
j5v_HomeImpl.java:267)
at
net.devicesWorld.deviceServer.server.device.command.CommandsToSendBean.getCommandToSend(CommandsToSendBean.java:97)
at
net.devicesWorld.deviceServer.server.device.command.CommandsToSendBean_uqhqrf_EOImpl.getCommandToSend(CommandsToSendBean_uqhq
rf_EOImpl.java
:413)
at net.devicesWorld.deviceServer.server.device.command.PollOnline.process(PollOnline.java:110)
at net.devicesWorld.deviceServer.server.device.command.CmdMessageBean.onMessage(CmdMessageBean.java:267)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:268)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Regards
LJS Narayana