- 3,716,133 Users
- 2,242,960 Discussions
- 7,845,840 Comments
Forum Stats
Discussions
Categories
- 17 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 1.6K Databases
- 479 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 5 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 417 SQLcl
- 42 SQL Developer Data Modeler
- 184.9K SQL & PL/SQL
- 21K SQL Developer
- 1.9K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.1K Development Tools
- 9 DevOps
- 3K QA/Testing
- 259 Java
- 6 Java Learning Subscription
- 11 Database Connectivity
- 67 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
- 125 LiveLabs
- 31 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 11 Español
- 1.9K Japanese
- 2 Portuguese
ODP.NET Core BLOB/CLOB read error

Hello.
ODP.NET Core is already in prelease, but still not supports elementary read blob/clob fields.
This simple code falls with "TTC Errror":
using (OracleConnection conn = new OracleConnection("Data Source=db;User ID=userid;Password=pass;Pooling=False;"))
{
conn.Open();
var sql = "SELECT id, blobdata FROM templ";
OracleCommand cmd = new OracleCommand(sql, conn);
cmd.CommandType = CommandType.Text;
OracleDataReader reader = cmd.ExecuteReader();
using (reader)
{
while (reader.Read()) //TTC Error
{
}
}
Answers
-
I tested out your sample code with a table that contains BLOB data and ODP.NET Core Beta 3. It worked.
Can you provide more details on the error? An ODP.NET trace would be especially useful.
Here's sample code for setting up and outputting a trace for ODP.NET Core.
OracleConfiguration.TraceFileLocation = @D:\traces; <-- Choose appropriate directory
OracleConfiguration.TraceLevel = 7;
-
It doesn't worked for me
Here sample code and traces.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0
sql:
create table t_cblob_test
(
id integer primary key,
data clob
);
insert into t_cblob_test values (1, null);
insert into t_cblob_test values (2, 'Hello, World!');
C#
static void Main(string[] args)
{
OracleConfiguration.TraceFileLocation = @A:\;
OracleConfiguration.TraceLevel = 7;
using (var connection = new OracleConnection("Data Source=database; User ID=user; Password=password"))
{
connection.Open();
using (var command = new OracleCommand("SELECT id, data FROM t_cblob_test", connection) { CommandType = CommandType.Text })
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
}
}
}
}
output:
Unhandled Exception: System.Exception: TTC Error
at OracleInternal.TTC.TTCExecuteSql.ReceiveExecuteResponse(Accessor[]& defineAccessors, Accessor[] bindAccessors, Boolean bHasReturningParams, SQLMetaData& sqlMetaData, SqlStatementType statementType, Int64 noOfRowsFetchedLastTime, Int32 noOfRowsToFetch, Int32& noOfRowsFetched, Int64& queryId, Int32 longFetchSize, Int64 initialLOBFetchSize, Int64[] scnFromExecution, Boolean bAllInputBinds, Int32 arrayBindCount, DataUnmarshaller& dataUnmarshaller, MarshalBindParameterValueHelper& marshalBindParamsHelper, Int64[]& rowsAffectedByArrayBind, Boolean bDefineDone, Boolean& bMoreThanOneRowAffectedByDmlWithRetClause, List`1& implicitRSList, Boolean bLOBArrayFetchRequired)
at OracleInternal.ServiceObjects.OracleDataReaderImpl.FetchMoreRows(Int32 noOfRowsToFetch, Boolean fillReader, Boolean returnPSTypes)
at Oracle.ManagedDataAccess.Client.OracleDataReader.Read()
at odp.net.clob.Program.Main(String[] args) in H:\odp.net.clob\odp.net.clob\Program.cs:line 20
traces:
-
Can you try your code out with 11.2 DB or higher? The problem is likely using an older DB server version. ODP.NET Core only supports 11.2 DB and higher. It does not support DB 10.2.
I tested the code snippet using DB 12.2 successfully.
-
It is absolutely impossible upgrade production business servers for a simple data access library.
In odp.net managed (not core) it works fine. Can you copy-past code non-worked part of code from it?
-
If Oracle fixed this particular issue, it does not guarantee you won't find other compatibility issues using DB 10.2. We have not done comprehensive 10.2 testing. If there's a 10.2 problem that requires a DB server fix or a client fix outside our immediate dev team, we cannot ensure that team will provide a fix since 10.2 extended support ended five years ago.
Because ODP.NET Core will go production with ODAC 18c, it follows the support policy of the Oracle DB Client 18c, which is backwards compatible with 11.2 DB servers and higher.