- 3,715,501 Users
- 2,242,777 Discussions
- 7,845,371 Comments
Forum Stats
Discussions
Categories
- 15 Data
- 362.2K Big Data Appliance
- 6 Data Science
- 1.5K Databases
- 461 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 3 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 416 SQLcl
- 42 SQL Developer Data Modeler
- 184.8K SQL & PL/SQL
- 21K SQL Developer
- 1.8K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.1K Development Tools
- 8 DevOps
- 3K QA/Testing
- 246 Java
- 5 Java Learning Subscription
- 10 Database Connectivity
- 66 Java Community Process
- 1 Java 25
- 9 Java APIs
- 141.1K Java Development Tools
- 6 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 10 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 124 LiveLabs
- 30 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 3 Deutsche Oracle Community
- 10 Español
- 1.9K Japanese
- 2 Portuguese
Difference between Dates / Entity Framework Core 3.1
Hello,
I have an exception when I try to get the difference between two dates (in Days) with the new Oracle.EntityFrameworkCore 3.19.0-beta1 NuGet package :
var row = (
from r in dbContext.Entitites
select new { (DateTime.Now - r.DateTimeColumn).Days }
).FirstOrDefault();
System.InvalidCastException: 'Specified cast is not valid.'
at Oracle.ManagedDataAccess.Client.OracleDataReader.GetDecimal(Int32 i)
at Oracle.ManagedDataAccess.Client.OracleDataReader.GetValue(Int32 i)
at System.Data.Common.DbDataReader.GetFieldValue[T](Int32 ordinal)
Best Answer
-
Yes, this bug will be fixed in production. The fix just missed our beta 2 freeze date.
Answers
-
Hi,
didn't see your post before mine but you can look at it for a temporary solution: Using DateTime.Today breaks with Entity Framework Core 3.1
Looks like if you pass a variable instead of DateTime.Now, it works.
-
I've filed Bug 31423881 to track this issue. The Oracle team will review the bug.
-
-
Unfortunately, I cannot publish with beta bugs. Nonetheless, I'm happy to update the status.
My team tried to reproduce the issue with the same query, but do not see the error. We created a table with a DateTime column, inserted a value, then ran the query. Are there other necessary conditions that need to be present for the error to occur? For example, does it occur with certain results only or a different time-based column type?
-
Here is a sample project (with an EF migration to create the table) that reproduces the problem : https://github.com/kakone/OracleBug31423881
I use an Oracle Server version 12.1.0.1.0 on Windows. -
Thanks for the test case! I can reproduce the problem. I will upload your test case to the bug.
-
The bug is not fixed with the beta 2 ;(
Is there any hope that it will be fixed in the final release ? -
Yes, this bug will be fixed in production. The fix just missed our beta 2 freeze date.