简体   繁体   English

企业库问题

[英]Enterprise Library issue

We are using Enterprise Library 6.0 and the following code to create database instance and execute a stored procedure? 我们使用Enterprise Library 6.0和以下代码来创建数据库实例并执行存储过程? Any help highly appreciated. 任何帮助高度赞赏。 Thanks in Advance. 提前致谢。

 DatabaseProviderFactory factory = new DatabaseProviderFactory();
             Database  db = factory.CreateDefault();

 DbCommand dbCommand = db.GetStoredProcCommand("ProcedureName");

                OracleParameter outval = new OracleParameter("Test", OracleDbType.RefCursor);
                outval.Direction = ParameterDirection.Output;
                dbCommand.Parameters.Add(outval);

                using (IDataReader reader = db.ExecuteReader(dbCommand))
                {
                    while (reader.Read())
                    {

                    }
                }

<add name="providerConnString" connectionString="Data Source=ABCD;Password=testuser;User ID=testpwd" providerName="Oracle.DataAccess.Client" />

Intermittently we are receiving the following exception. 我们间歇性地收到以下异常。 This is occurring when we are trying to access the application after an idle time. 当我们在空闲时间之后尝试访问应用程序时会发生这种情况。 How the connection pooling happens in enterprise library?How will it work if the application is idle for long time? 连接池如何在企业库中发生?如果应用程序长时间处于空闲状态,它将如何工作? What is the default min pool size and default max pool size? 什么是默认的最小池大小和默认的最大池大小?

Exception has been thrown by the target of an invocation. 调用的目标抛出了异常。 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.TargetInvocationException:调用目标抛出了异常。 ---> System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleClientFactory' threw an exception. ---> System.TypeInitializationException:'Oracle.DataAccess.Client.OracleClientFactory'的类型初始值设定项引发了异常。 ---> System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.CThreadPool' threw an exception. ---> System.TypeInitializationException:'Oracle.DataAccess.Client.CThreadPool'的类型初始值设定项引发了异常。 ---> System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {CB2F6723-AB3A-11D2-9C40-00C04FA30A3E} failed due to the following error: 800703fa Illegal operation attempted on a registry key that has been marked for deletion. ---> System.Runtime.InteropServices.COMException:检索具有CLSID {CB2F6723-AB3A-11D2-9C40-00C04FA30A3E}的组件的COM类工厂因以下错误而失败:800703fa对已注册的注册表项执行了非法操作标记为删除。 (Exception from HRESULT: 0x800703FA). (来自HRESULT的异常:0x800703FA)。 at Oracle.DataAccess.Client.CThreadPool..cctor() --- End of inner exception stack trace --- at Oracle.DataAccess.Client.OracleInit.Initialize() --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.RuntimeFieldHandle.GetValue(RtFieldInfo field, Object instance, RuntimeType fieldType, RuntimeType declaringType, Boolean& domainInitialized) at System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj) at System.Reflection.RtFieldInfo.InternalGetValue(Object obj, StackCrawlMark& stackMark) at System.Reflection.RtFieldInfo.GetValue(Object obj) at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow) at Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDefaultMapping(String dbProviderName) at Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDatabaseData(ConnectionStringSettings connectionString, DatabaseSettings databaseSettings) at Microsoft.Practices 在Oracle.DataAccess.Client.CThreadPool..cctor()---内部异常堆栈跟踪结束---在Oracle.DataAccess.Client.OracleInit.Initialize()---内部异常堆栈跟踪结束--- - - 内部异常堆栈跟踪的结束---在System.Reflection的System.Reflection.RtFieldInfo.UnsafeGetValue(Object obj)处的System.RuntimeFieldHandle.GetValue(RtFieldInfo字段,Object实例,RuntimeType fieldType,RuntimeType declaringType,Boolean&domainInitialized)处。位于Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDefaultMapping的System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)的System.Reflection.RtFieldInfo.GetValue(Object obj)中的RtFieldInfo.InternalGetValue(Object obj,StackCrawlMark和stackMark) (字符串dbProviderName)Microsoft.Practices上的Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDatabaseData(ConnectionStringSettings connectionString,DatabaseSettings databaseSettings) .EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings.GetDatabase(String name) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseProviderFactory.DatabaseConfigurationBuilder.b__2(String n) at System.Collections.Concurrent.ConcurrentDictionary 2.GetOrAdd(TKey key, Func 2 valueFactory) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseProviderFactory.DatabaseConfigurationBuilder.CreateDefault() System.Collections.Concurrent.ConcurrentDictionary上的Microsoft.Practices.EnterpriseLibrary.Data.DatabaseProviderFactory.DatabaseConfigurationBuilder.b__2(String n)中的2.GetOrAdd(TKey key, Func (String name) 2.GetOrAdd(TKey key, Func 2 valueFactory) )在Microsoft.Practices.EnterpriseLibrary.Data.DatabaseProviderFactory.DatabaseConfigurationBuilder.CreateDefault()

I had a issue with the App pool identity user in IIS. 我在IIS中遇到了App pool身份用户的问题。 I removed the identity user and put the default identity user. 我删除了身份用户并放置了默认身份用户。 Then reverted back to my custom user identity. 然后恢复为我的自定义用户身份。 This resolved my issue. 这解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM