Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Get_DBTIMESTAMP: unrepresentable DateTime

Get_DBTIMESTAMP: unrepresentable DateTime

From: Stefan M. Dohn <stefan.dohn_at_web.de>
Date: Sat, 28 Feb 2004 20:52:30 +0100
Message-ID: <c1qrh0$iai$1@online.de>


Hello,
our .NET webservice intermittently fails when retrieving DATE values from the database, see exception below. We have checked the DATE values in the database, checked regional settings of the middle-tier machine, tested with domain and local users. The application can run for hours reading a constant DATE field from a database table, but suddenly it fails. Usually, we restart the ASPNET process but sometimes the problem can disappear by itself after some 30 minutes.
It does not help either to explicitly set the date format when grabbing a connection from the connection pool:
ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD HH24:MI:SS' Has anybody encountered similar problems?

System info:
Middle-tier: W2K SP5, .NET 1.1, Oracle 9.2.0.2.1, Oracle OLEDB 9.2.0.1.0
Server: Oracle 9.2.0.3 for Sun Solaris

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Hour, Minute, and Second parameters describe an unrepresentable DateTime.
at System.DateTime.TimeToTicks(Int32 hour, Int32 minute, Int32 second)
at System.Data.OleDb.DBBindings.Get_DBTIMESTAMP(IntPtr buffer)

at System.Data.OleDb.DBBindings.get_Value_DBTIMESTAMP()
at System.Data.OleDb.DBBindings.get_Value()
at System.Data.OleDb.OleDbDataReader.GetValue(Int32
ordinal)
at System.Data.OleDb.OleDbCommand.ExecuteScalar() at OM.Exigo.SGDatabaseD.CDbAccess.RunSQLReturnObject (String sqlStmt, CDbParameter[] parameters)

As a work-around, we now return DATE fields as strings and let .NET implicitly convert it to a Date value when filling datasets. So obviously, it is no bug in .NET since it always succeeds to convert strings to Dates. It cannot be a network problem either, since then we would have observed data corruption in non-date fields.

Compare also newsgroup microsoft.public.data.oledb, Subject:Get_DBTIMESTAMP: unrepresentable DateTime

Regards,
Stefan Received on Sat Feb 28 2004 - 13:52:30 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US