Skip to content

Fix Oracle bulk insert schema qualification issues#97

Open
DPschichholz wants to merge 2 commits intoPhenX:mainfrom
DPschichholz:main
Open

Fix Oracle bulk insert schema qualification issues#97
DPschichholz wants to merge 2 commits intoPhenX:mainfrom
DPschichholz:main

Conversation

@DPschichholz
Copy link
Copy Markdown

@DPschichholz DPschichholz commented May 7, 2026

Fix Oracle bulk insert ORA-39831 when EF Core default schema is configured

  • Fix double-schema qualification when EF Core default schema is configured
  • Clarify table name handling comment
  • Add OpenTelemetry instrumentation project and update README

Details

When HasDefaultSchema(...) is set, tableInfo.QuotedTableName becomes a SQL-quoted fully qualified identifier (e.g. "SchemaX"."TableA"). Passing this to OracleBulkCopy.DestinationTableName causes ODP.NET to double-apply the schema, producing SchemaX.SchemaX.TableA and failing with ORA-39831.

Change

  • OracleBulkInsertProvider.BulkInsert: compute destinationTableName before assigning to bulkCopy.DestinationTableName:
    • Direct insert path (tableName == tableInfo.QuotedTableName): use tableInfo.TableName (plain unquoted name — ODP.NET resolves the schema itself)
    • Temp table path: use tableName unchanged
var destinationTableName = tableName == tableInfo.QuotedTableName
    ? tableInfo.TableName
    : tableName;

bulkCopy.DestinationTableName = destinationTableName;

- Fix double-schema qualification when EF Core default schema is configured
- Clarify table name handling comment
@DPschichholz DPschichholz marked this pull request as ready for review May 7, 2026 08:25
@DPschichholz DPschichholz requested a review from PhenX as a code owner May 7, 2026 08:25
@SebastianStehle
Copy link
Copy Markdown
Collaborator

I cant speak for Oracle.

But is the whole Trace stuff not part of .NET itselt? Something like ActivitySource? And where is it actually used? I don't see it. In general I am big fan of it, but I would make a seperate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants