- 3,708,688 Users
- 2,241,109 Discussions
- 7,840,539 Comments
Forum Stats
Discussions
Categories
- 7 Data
- 362.2K Big Data Appliance
- 2 Data Science
- 1K Databases
- 322 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 479 MySQL Community Space
- 3 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.7K ORDS, SODA & JSON in the Database
- 408 SQLcl
- 32 SQL Developer Data Modeler
- 184.6K SQL & PL/SQL
- 20.9K SQL Developer
- 1.3K Development
- Developer Projects
- 31 Programming Languages
- 134.5K Development Tools
- 4 DevOps
- 3K QA/Testing
- 172 Java
- 3 Java Learning Subscription
- 6 Database Connectivity
- 64 Java Community Process
- Java 25
- 7 Java APIs
- 141.1K Java Development Tools
- 2 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 132 Java 8 Questions
- 86.1K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 5 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 79 LiveLabs
- 23 Workshops
- 7 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 3 Deutsche Oracle Community
- 6 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)
2
Best Answer
-
Alex Keh-Oracle Posts: 2,720 Employee
Yes, this bug will be fixed in production. The fix just missed our beta 2 freeze date.
0
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.
Can you make the bugs public so we can track their status ?
user2082593
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.