Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Get_DBTIMESTAMP: unrepresentable DateTime
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(Int32ordinal)
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