Starting from 1.1.0, the OceanBase.ManagedDataAccess driver unifies the external namespace from Oceanbase to OceanBase.
This is a case-sensitive change. In C#, inconsistent namespace casing can lead to compilation failures.
Change details
- Old namespace:
Oceanbase - New namespace:
OceanBase
Examples
| Before | After |
|---|---|
using Oceanbase; |
using OceanBase; |
Oceanbase.OracleConnection |
OceanBase.OracleConnection |
Oceanbase.OracleCommand |
OceanBase.OracleCommand |
Oceanbase.OracleParameter |
OceanBase.OracleParameter |
Oceanbase.OracleDbType |
OceanBase.OracleDbType |
Common errors in business code
After upgrading to V1.1.0, if your business code still uses the Oceanbase namespace, you may encounter the following errors.
1. using statement errors
Common compilation errors:
- CS0246: The type or namespace name
Oceanbasecould not be found - CS0234: The type or namespace name
XXXdoes not exist in the namespaceOceanbase
Example (error):
using Oceanbase;
using Oceanbase.EntityFrameworkCore;
Should be changed to:
using OceanBase;
using OceanBase.EntityFrameworkCore;
2. Type or enum name errors
If your code directly uses the fully qualified name, it will also fail to compile.
Example (error):
var conn = new Oceanbase.OracleConnection(connectionString);
var cmd = new Oceanbase.OracleCommand(sql, conn);
var type = Oceanbase.OracleDbType.Varchar2;
Should be changed to:
var conn = new OceanBase.OracleConnection(connectionString);
var cmd = new OceanBase.OracleCommand(sql, conn);
var type = OceanBase.OracleDbType.Varchar2;
3. Reflection or string configuration errors at runtime
If your business code stores type names as strings, you also need to update them. Otherwise, you may encounter issues such as Type.GetType(...) returning null or dynamic loading failures.
Example (error):
Oceanbase.OracleConnection
Should be changed to:
OceanBase.OracleConnection
Troubleshooting and modification steps
We recommend that you follow these steps to troubleshoot and modify your code.
- Search globally for
Oceanbase(case-sensitive) in your business code repository. - Replace all namespace references with
OceanBase. - Check the following areas carefully:
usingstatements- Fully qualified type names
- Fully qualified enum names
global usingtypeof(...)- Reflection strings and configuration strings (including JSON, XML, and database configuration tables)
Note
- This change mainly focuses on **normalizing the case sensitivity of namespaces**.
- Do not change your business logic based on this change. The NuGet package references should remain as they are.
- If you encounter compilation errors indicating that a type or namespace does not exist after the upgrade, check if there are any remaining references to the old `Oceanbase` namespace that have not been replaced.
