Hi All,
I have been struggling with this error since long time.
my application is using LLBLGen 2.0.0.0 version to connect to Oracle database (10.2.0.4). We have oracle client with version 9.2.0.4 installed in the application server.
The problem is that my application some times (not consistence) throws ORA-12154: TNS:could not resolve service exception. Some times it works fine and some times we get this error message in different pages. Once this error start occouring it keep occouring and after some time it starts working by itself. Some times so happens that our application keep getting this error and our application is down, then we have to restart our IIS, which fixes the problem for couple of hours.
My connection string is Data Source=DatabaseSID.DOMAIN NAME; User Id=XYZ; Pwd=ABC
I am successfully being able to use TNSping. TNSping uses sqlnet.ora files which points to sqlnet.names. Sqlnet.names uses NAMES.DIRECTORY_PATH = (TNSNAMES, ONAMES). I think if i am able to use TNSping that indicates the sqlnet.ora/sqlnet.names file is fine
.
I have below question as i have observed that when traffic increases the number of above exception increases.
Q 1) I can see in the helper class generated by LLBL, it uses System.Data.OracleClient.oracleConnection to establish a connection. OracleConnection represents an open connection. I do not find in any place, the connection is beeing closed. For every save that i hit a transaction is being used, we are closing that transaction, but not connectin.
Q2) After we get exception on a page we are login the error in a table. To my surprise if i get TNS error, even after that the error is being loged in the database. I am unable to understand if the system could not resolve service name for request then how could it establish connection to database to log error? I am providing the stack trace below. Please help me get rid of this problem.
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OracleClient.OracleConnection.Open()
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase1.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase
1.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations)