Print Page | Close Window

Unable to manage persistence of...

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2515
Printed Date: 13-Sep-2025 at 11:51am


Topic: Unable to manage persistence of...
Posted By: chrishibler
Subject: Unable to manage persistence of...
Date Posted: 18-Feb-2011 at 5:35am
 One of our customers is receiving an error occasionally when logging into our application. The stack trace from the debug log is below. What we're doing at this point is reinitializing the schema for the dynamic entity types in the database. We get the dynamic type for the table and then create an entity query to return a single row.

 

They continue to get this error until they reset IIS (we're using a business object server). Once IIS is reset, the error no longer occurs. If they had offline data in their cache files though, they are reporting that the data is lost.

 

We're using DevForce classic 3.6.7.1 in this version of our application.

 

Any insight into this would be much appreciated.

 

Server stack trace:

   at IdeaBlade.Persistence.Rdb.RdbTableMappingInfo.GetFromTable(EntityTable pTable)

   at IdeaBlade.Persistence.Rdb.RdbQuerySqlFormatter.BuildCanonicalQuery(Type pEntityType, ParameterizedSql pWhereClause, IEnumerable`1 pOrderByClauses)

   at IdeaBlade.Persistence.Rdb.RdbQuerySqlFormatter.BuildCanonicalQuery(EntityQuery pEntityQuery, Int32& pNextBindingId)

   at IdeaBlade.Persistence.Rdb.RdbQuery.Fetch(DataSet pDataSet, IDataSourceKey pDataSourceKey)

   at IdeaBlade.Persistence.Server.PersistenceServer.Fetch(IEntityQuery pQuery, DataSet pDataSet, IDataSourceKey pDsKey)

   at IdeaBlade.Persistence.Server.PersistenceServer.Fetch(SessionBundle pSessionBundle, IEntityQuery pEntityQuery)

   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)

   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

 

Exception rethrown at [0]:

   at IdeaBlade.Persistence.RemotingPersistenceServerProxy.CheckConnection(Exception pException)

   at IdeaBlade.Persistence.PersistenceServerProxy.Fetch(SessionBundle pBundle, IEntityQuery pQuery)

   at IdeaBlade.Persistence.PersistenceManager.XFetchDataSet(IEntityQuery pEntityQuery)

   --- End of inner exception stack trace ---

   at IdeaBlade.Persistence.PersistenceManager.HandlePersistenceServerException(Exception pException, Boolean pTryToHandle, PersistenceOperation pOperation)

   at IdeaBlade.Persistence.PersistenceManager.XFetchDataSet(IEntityQuery pEntityQuery)

   at IdeaBlade.Persistence.PersistenceManager.InitializeSchema(Type pEntityType)

   at IdeaBlade.Persistence.PersistenceManager.XGetEntities(IEntityQuery pEntityQuery, QueryStrategy pQueryStrategy, WorkState pWorkState)

   at IdeaBlade.Persistence.PersistenceManager.GetEntity(IEntityQuery pEntityQuery, QueryStrategy pQueryStrategy)

   at IdeaBlade.Persistence.PersistenceManager.GetEntity(IEntityQuery pEntityQuery)

   --- End of inner exception stack trace ---

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

   at System.Delegate.DynamicInvokeImpl(Object[] args)

   at DecadeNet.Shared.Libraries.Persistence.PersistenceServices.handleQueryError(Exception pException, Delegate pMethod, Object[] pMethodParams)

   at DecadeNet.Shared.Libraries.Persistence.ServiceCallIntercept.QueryServiceCall(Type pDelegateType, Object[] pMethodParams, String pMethodName, Type pEntityType)

   at DecadeNet.Shared.Libraries.Persistence.PersistenceServices.GetEntity(IEntityQuery pEntityQuery)

   at DecadeNet.Shared.Libraries.BusinessEntities.UDFEntityServices.cacheSingleRow(Type pEntityType)

   at DecadeNet.Shared.Libraries.BusinessEntities.UDFEntityServices.initializeUserDefinedEntityTableTypes()

   at DecadeNet.Shared.Libraries.BusinessEntities.UDFEntityServices.Reinitialize()

   at DecadeNet.RichClientApps.EnvisionConnect.MainAppController.authenticateClient(String pUserName, String pPassword)

   at DecadeNet.RichClientApps.EnvisionConnect.MainAppController.Login(String pUserName, String pPassword)

   at DecadeNet.RichClientApps.EnvisionConnect.HomeActivities.Pages.LogInPatternPage.login()




Replies:
Posted By: kimj
Date Posted: 18-Feb-2011 at 12:54pm
I'm curious about your statement "...reinitializing the schema for the dynamic entity types ...".   Once a dynamic entity type is defined for a data source extension, it's schema cannot be changed.   How is the schema re-initialized?  Also, what does this query look like? 
 
The error message itself indicates that DevForce thinks the prototype table built when the EntityTypeInfo was constructed and the dynamic type was created is somehow wrong.  Is it possible that you have multiple paths to creating/initializing this entity type and only one is "correct"?


Posted By: chrishibler
Date Posted: 22-Feb-2011 at 2:03pm

I suppose reinitialize is not the correct term. We go through all the tables we represent as dynamic types, verify that the type is created and if it is not created, we create the type.

The query just get's a single entity:
 
EntityQuery query = new EntityQuery(pEntityType);
query.Top = 1;


Posted By: kimj
Date Posted: 23-Feb-2011 at 8:36am
OK, so my last question still stands.  If an IIS reset fixes the problem it would indicate that the prototype table was either constructed incorrectly or somehow corrupted.   Does the application work correctly for a period of time, and then a login randomly fails?


Posted By: chrishibler
Date Posted: 23-Feb-2011 at 10:12am
At this location, users often have offline data and they don't reconnect to save that data until the next morning.

Additionally, the system at this location is configured to recycle the application pool each night or early morning (I'm getting details regarding when this is scheduled). 

So far, what we've seen is that, the application will be working properly during the day. When the users begin to login in the morning, that's when this begins to occur. After it happens, all users are prevented from logging in from that point forward with the same error, which seems like it also indicates the prototype table was either constructed incorrectly or somehow corrupted.

I don't see multiple paths for creating the types. We would be creating them from the same database tables so if there were more than one path, they would be doing the same thing.


Posted By: kimj
Date Posted: 23-Feb-2011 at 6:42pm
This is beginning to sound like a multi-threading problem, since  I'd guess multiple users could be logging in at the same time.   If you can provide us more info (you can send an email if you don't want to post here) about what's going on in this login/query process with dynamic types, we'll see if we can repro.



Print Page | Close Window