Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value cannot be null.Parameter name: stream #160

Open
Giorgi opened this issue Mar 30, 2021 · 2 comments
Open

Value cannot be null.Parameter name: stream #160

Giorgi opened this issue Mar 30, 2021 · 2 comments

Comments

@Giorgi
Copy link

Giorgi commented Mar 30, 2021

When I try to connect to database with a custom database character set I get the following exception:

Value cannot be null.Parameter name: stream
at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPR(Int32 reqCount, Boolean bForPoolPopulation, ConnectionString csWithDiffOrNewPwd, CriteriaCtx criteriaCtx, String instanceName, List`1 switchFailedInstNames)   at 
OracleInternal.ConnectionPool.PoolManager`3.Get(ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)   at 
OracleInternal.ConnectionPool.OraclePoolManager.Get(ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch)   at 
OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get(ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString securedPassword, SecureString securedProxyPassword, CriteriaCtx criteriaCtx)   at 
Oracle.ManagedDataAccess.Client.OracleConnection.Open()   at UserQuery   at 
System.Threading.ThreadHelper.ThreadStart_Context(Object state)   at 
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)   at
 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)   at 
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)   at 
System.Threading.ThreadHelper.ThreadStart()

ODP.NET version: 19.11.0
When I use unmanaged database provider it works fine.

Output of select * from nls_database_parameters where parameter='NLS_CHARACTERSET' : GEO8BOGALTWIN

The exception happens because the managed driver tries to deserialize an embedded resource based on the database character set in OracleInternal.I18N.Conv.GetInstance but it doesn't contain one for the charset that we use.

It would be great if we could use the nlt or nlb files that we have that contain the character set that we use.

@alexkeh
Copy link
Member

alexkeh commented Mar 30, 2021

I filed an ER (32703961) for this feature request.

@Giorgi
Copy link
Author

Giorgi commented Mar 30, 2021

I added AppDomain.CurrentDomain.FirstChanceException event handler I see this exception occurring when opening a connection:

Value cannot be null. Parameter name: stream

at System.IO.Compression.DeflateStream..ctor(Stream stream, Boolean leaveOpen, IFileFormatReader reader)   at 
System.IO.Compression.GZipStream..ctor(Stream stream, CompressionMode mode, Boolean leaveOpen)   at 
OracleInternal.I18N.TLBConvBoot.ReadObj(String entryName)   at OracleInternal.I18N.TLBConv.GetGLBInstance(Int32 oraId)   at 
OracleInternal.I18N.Conv.GetInstance(Int32 charsetId)   at 
OracleInternal.ServiceObjects.OracleConnectionImpl.DoProtocolNegotiation()   at 
OracleInternal.ServiceObjects.OracleConnectionImpl.Connect(ConnectionString cs, Boolean bOpenEndUserSession, OracleConnection connRefForCriteria, String instanceName)

I don't know how unmanaged driver works but if it is able to connect to the database the managed one should be able too. Even if it doesn't convert the characters to the ones that we have mapped to it would be enough if it worked and returned the unencoded data that we can map based on our mapping.

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

No branches or pull requests

2 participants