- Home
- LLBLGen Pro
- LLBLGen Pro Runtime Framework
Transport level after restoring database and trying to reconnect
Joined: 26-Nov-2009
I’m using LLBLGen Pro, version: 2.6 final, SQL Server 2005, IIS 5.1 registered with ASP.Net 2.0. I’m using LLBLGen with adapters. File version of SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll is: 2.6.09.0327.
I have a problem when restoring an SQL database using SMO, and then after trying to connect to the restored database using LLBLGen adapter I get an exception. The code snippet for restoring the database is:
SQLServerInstance.KillDatabase(catalogName); Restore rst = new Restore(); rst.Action = RestoreActionType.Database; rst.Database = catalogName; rst.Devices.Add(new BackupDeviceItem(backupFileName, DeviceType.File)); rst.SqlRestore(SQLServerInstance);
SqlConnection.ClearAllPools();
Then when attempting to re-establish a connection using a LLBLGen adapter and then trying to fetch an entity from the database I get the following exception:
SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.). Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParserStateObject.WriteSni() at System.Data.SqlClient.TdsParserStateObject.WritePacket(Byte flushMode) at System.Data.SqlClient.TdsParserStateObject.ExecuteFlush() at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) --- End of inner exception stack trace --- at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.PerformExecuteSingleRowRetrievalQuery(IRetrievalQuery queryToExecute, CommandBehavior behavior) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteSingleRowRetrievalQuery(IRetrievalQuery queryToExecute, IEntityFields2 fieldsToFill, IFieldPersistenceInfo[] fieldsPersistenceInfo) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingFilter(IEntityFields2 fieldsToFetch, IFieldPersistenceInfo[] persistenceInfos, IRelationPredicateBucket filter) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntityUsingFilter(IEntity2 entityToFetch, IPrefetchPath2 prefetchPath, Context contextToUse, IRelationPredicateBucket filter, ExcludeIncludeFieldsList excludedIncludedFields) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntity(IEntity2 entityToFetch, IPrefetchPath2 prefetchPath, Context contextToUse, ExcludeIncludeFieldsList excludedIncludedFields) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchEntity(IEntity2 entityToFetch) at CommonServices.LlblGenHelper.FetchEntity[T](T entity, DataAccessAdapterBase adapter) in D:\Development\B_1_3_1_1\Pkg\IQP\Servers\Common\CommonServices\LlblGenHelper.cs:line 96
Note also that the code is hosted in the server in WCF services that are hosted under IIS. The connection string is set with Pooling=True. If I set Pooling=false I don’t get the exception.
I saw that you answered the same problem in the following thread: (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=14772&HighLight=1) but you are refering to a broken link in MSDN forum. Is there any setting in the LLBLGen adapter for solving this problem?
Thanks Shmuel Levin