- Home
- LLBLGen Pro
- LLBLGen Pro Runtime Framework
The IPersistenceInfoProvider object of this DataAccessAdapter is null. LLBLGEN 5.7.2
Joined: 02-Mar-2021
Hello we migrated our application from LLBLGEN v3.5 to v5.7.2 we also changed the oracle.DataAccess to oracle.ManagedDataAccess on server side all working fine. from client using ORMSupportClasses.DataAccessAdapter i'm receiving this Error : The IPersistenceInfoProvider object of this DataAccessAdapter is null. SD SupportClasses DLL version : 5.7.2 dotnet framework version : 4.5.2 unfortunately duto security matter i cant paste a stuck trace . from stuck trace , the error accured at ORMSupportClasses.DataAccessAdapterCore.GetFieldPersistenceInfo(IFieldInfo fieldInfo) at ORMSupportClasses.DataAccessAdapterCore.InsertPersistenceInfoObjects(IPredicateExpression expression) .... my ClientDataAccessAdapter is inherited by ORMSupportClasses. DataAccessAdapterBase any help will be much appriciated thank you
Joined: 17-Aug-2003
As you migrated to a version > 5.4, did you make sure the csproj files are in the right location? As these are moved since 5.4 https://www.llblgen.com/Documentation/5.8/LLBLGen%20Pro%20RTF/migratingcode.htm#migrating-generated-code-from-v5.3-to-v5.4
It looks like the DbSpecific csproj project file isn't properly defined. If anything, please generate the two project files in an empty folder and see if that fixes things.
Joined: 02-Mar-2021
Otis wrote:
As you migrated to a version > 5.4, did you make sure the csproj files are in the right location? As these are moved since 5.4 https://www.llblgen.com/Documentation/5.8/LLBLGen%20Pro%20RTF/migratingcode.htm#migrating-generated-code-from-v5.3-to-v5.4
It looks like the DbSpecific csproj project file isn't properly defined. If anything, please generate the two project files in an empty folder and see if that fixes things.
thank you for your reply otis my migration was from 3.5 to 5.7.2 i handled the projects files issue regarding migration to ver 5.4 .. but i did it again as your suggestion i am able to use the generic and DBSpecific ok when working on server side . but when using custom ClientDataAccessAdapter inherited to DataAcessAdapterBase its constructor calls :base(null) and DataAccessAdapterBase constructor needs a PersistenceInfoProvider param . wich i cant pass from the client so i think the issue is related the migrating to 4.2 since its the only place that object is mentioned .. not realy sure about that . this code woked fine before the migration and i realy dont know where the problem is any idea ? with kindly regards, guy
Joined: 02-Mar-2021
Walaa wrote:
Please make sure the client side is using/referencing the same version of libraries as used in the served, whether for the generated or the runtime.
yes , all using the same library version 5.7.0 . DBSpecific \General . generated and runtime . on all projects in server side and the client side.
Joined: 17-Aug-2003
I am a little puzzled what the client does: if the client instantiates the DataAccessAdapter class, it needs the persistenceinfoprovider class that's in the same assembly. So the generated dbspecific project that's used on teh server also has to be present on the client.
However if you use the persistence logic on the server, no idea why you need the adapter on the client. Hence my question what the client actually does/need to do with a database.
Joined: 02-Mar-2021
Otis server is using an extension DataAccessAdapter which inherits DatabaseSpesific.DataAccessAdapter . and therefor have no problem with persistence initializatioin. client using custom ClientDataAccsessAdapter which inherits ORMSupportClasses.DataAccessAdapterBase , the constaructor sends :base(null). client fetching data from DBviews objects for UI GRIDViews using LinqMetaData
i tried to referance the DatabaseSpesific and use its adapter . but as expected its throwing errors for connection string , wich does not included in the client app config.
before the migration from 3.5 to 5.7 its works , now with the new FetchEntityCollection implementation with the one recieving QueryParameters insted of seperated list it is not . and seems like the new refactoring changed the need or the initialization of persistenceInfoProvider . any thing i can do to handle that ?
Joined: 02-Mar-2021
one more thing do you think any of this can be influanced by replacing of oracle.DataAccess client to ManagedDataAccsses client driver ? since in addition of migrating LLBLGen Version we also replace the oracle client driver.
Joined: 17-Aug-2003
guyronen wrote:
Otis server is using an extension DataAccessAdapter which inherits DatabaseSpesific.DataAccessAdapter . and therefor have no problem with persistence initializatioin. client using custom ClientDataAccsessAdapter which inherits ORMSupportClasses.DataAccessAdapterBase , the constaructor sends :base(null). client fetching data from DBviews objects for UI GRIDViews using LinqMetaData
Yes that's not going to work, you can't just create a custom data access adapter and pass null for the persistence info provider. Why would you do that? If you want to fetch data on the client, you need to use the one that's generated for you. The persistenceinfoprovider class is required to produce sql. No idea what your client adapter does, likely create queries to be send to the server? In any case, you can pass a derived class of PersistenceInfoProviderBase to the ctor instead of
null`, to use the adapter on the client. I have no idea if that works, it's not the designed intention for that class.
The oracle provider has nothing to do with it.
Joined: 02-Mar-2021
Otis wrote:
guyronen wrote:
Otis server is using an extension DataAccessAdapter which inherits DatabaseSpesific.DataAccessAdapter . and therefor have no problem with persistence initializatioin. client using custom ClientDataAccsessAdapter which inherits ORMSupportClasses.DataAccessAdapterBase , the constaructor sends :base(null). client fetching data from DBviews objects for UI GRIDViews using LinqMetaData
Yes that's not going to work, you can't just create a custom data access adapter and pass null for the persistence info provider. Why would you do that? If you want to fetch data on the client, you need to use the one that's generated for you. The persistenceinfoprovider class is required to produce sql. No idea what your client adapter does, likely create queries to be send to the server? In any case, you can pass a derived class of
PersistenceInfoProviderBase to the ctor instead of
null`, to use the adapter on the client. I have no idea if that works, it's not the designed intention for that class.The oracle provider has nothing to do with it.
Correct , client is creating a query and use a proxy to the server with adapter to use to fetch the data into GridData <vw_Entity> before client only needed the General DLL to know the Entities . and it works without referance or use the DBSpesific and its PersistenceInfo. i referenced the DBSpesific and sent its PersistanceInfo to base constractor as you suggest.. I also succeded to handle the PersistenceInfoProvider problenm and able to use adapter without sending it to base as it worked before () but now it throw other Exception, SerializationException : Predicat Expression cannot be serialized. consider marking it with the DataContractAttribute ... etc .I am pointing you to Migration breaking Change to 4.0 with the change of QueryParameter insteed of param List . following that change in implementation QueryParameters object include the PredicateExpressioin which is in the error i get ) this object is an ORMSupportClasses.PredicateExpression , and need to be passed through wcf service , i cant do much about it . might be something changed withthat implementation related to pass through WCF services ? any idea how can i solve that problem ? thanks in advanced, guy
Joined: 17-Aug-2003
You really have to give specifics as just a piece of text isn't going to help. What is the code you're using to serialize what object, and if you get an error, the stacktrace is essential. The predicates are serializable but I have no idea what you're serializing.
Joined: 02-Mar-2021
hello Otis, here are the usage in code and the Exception i get.
new implementation with QueryParameters
from client
public void Get(QueryParameters parameters)
{
this.Channel.Get(parameters);
}
function at server
internal void Execute(QueryParameters parameters)
{
using (IDataAccessAdapter adapter = DataAccessAdapterFactory.GetAdapter())
{
adapter.FetchEntityCollection(parameters);
}
}
it fails on serialization for SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression when try to fetch the query
at this point :
TaskFactory.StartNew<IList<TItem>>(() => query.Take(pageSize).ToList())
.ContinueWith(p => Post(() => RiseGetInitPageCompleted(p)), TaskSchedulers.DefaultScheduler);
stack trace is attached .
exception is :
<Exception handlingInstanceId="8dade81e-c4e4-4794-8c34-48d72a3a99b8"><Description>An exception of type 'System.Runtime.Serialization.InvalidDataContractException' occurred and was caught.</Description><DateTime>2021-03-07 09:22:56Z</DateTime><ExceptionType>System.Runtime.Serialization.InvalidDataContractException, System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Type 'SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types.</Message>
Filename | File size | Added on | Approval |
---|---|---|---|
Exception.txt | 10,170 | 07-Mar-2021 21:38.16 | Approved |
Joined: 28-Nov-2005
We are not sure what exactly are you doing that communicate client and server. We think with the information you gave us at this point, that you are generating a service which exposes the virtual methods of the DataAccessAdatper and also creates a client proxy class where the virtual methods are overridden and make calls to their counterparts on the service. We think this used to work because in old versions you used predicates and RelationCollection as arguments. Now in newer versions the new way is to use QueryParameters, which is not intended for this kind of use.
Joined: 17-Aug-2003
PredicateExpression objects and the like are serializable to XML, but your service requires a DataContract attribute, which is strange as the original service you had should also require that if nothing changed. Did that change?
The predicateexpression is serializable to xml because can be part of a unit of work. It's however recommended to write services without an open API but with methods that accept arguments which are used to build the predicates on the service.
You have to realize: we don't know what you're doing with the service, you post sparse bits of info. Also, what worked in the old version might not work today due to breaking changes and e.g. the changes in moving to asp.net core / async which enforces contracts on elements being serialized that wasn't present in the old service.
I have no idea how much methods you have in the service, but you could opt for pre-serializing the predicates, relationcollection and the other elements you sent over to xml, using an XmlWriter and the IXmlSerializable interface implemented on them. Then send the resulting xml over to the service, deserialize it there into the objects you expect and proceed as normal. QueryParameters isn't serializable in any way, you can't just expose that in a service.
Joined: 17-Aug-2003
Additionally, I think you generated client classes through e.g. vs from the service' api and this creates proxy classes for all types. Could you try to use the service' original API, i.e. expose the predicateexpression, relationcollection and the like in the method signature, so they're passed directly (and thus serialized by WCF/service).
Joined: 02-Mar-2021
Hi Otis
thanks, its sounds as a good solution and may be work . i will pass the inner objects as parameters through the proxy service from client to server . i'm overriding the Fetch Method as follow .. it seems now that predicateexpression, relationcollection and the like passes to server success . but as for now , still have problem getting the data . something not working with the filter bucket , its not getting the select Alias value . also when i init it specific while fetching from database its stuck and freeze . it may be related now to usage with ManagedOracleClient . i will continue this direction to found how to solve that . here is the method call i refactored from client.
//Client -
public class ClientDataAccessAdapter : DataAccessAdapterBase
{
public override void FetchEntityCollection(QueryParameters parameters)
{
try
{
TypeInfo entityTypeInfo = this.GetEntityTypeInfo((IEntityCollection2)parameters.CollectionToFetch);
IEntityCollection2 serverResult = this.Proxy.Get(entityTypeInfo, parameters.FilterRelationsAsBucket, parameters.RowsToTake, parameters.SorterToUse, (IPrefetchPath2)parameters.PrefetchPathToUse,
parameters.ExcludedIncludedFields, 1, parameters.RowsToTake);
this.MergeResult((IEntityCollection2)parameters.CollectionToFetch, serverResult);
}
catch (Exception ex)
{
throw new InfrastructureDataQueriesGetOperationException(ex);
}
}
}
{
//Server
public class NessDataAccessAdapter : DataAccessAdapter
{
public override void FetchEntityCollection(QueryParameters parameters)
{
base.FetchEntityCollection(parameters);
}
}
Joined: 17-Aug-2003
You don't show what you do on the server (i.e. where you construct the QueryParameters again). It might be a good idea to enable tracing to log what SQL is generated for your query. This allows you to see if the elements you passed are indeed reassembled properly to QueryParameters or that something's not passed properly. For how to enable tracing (you have to do that on the service side), see: Troubleshooting and debugging in the documentation. (this is for v5.8 but same information applies to older versions)
Joined: 02-Mar-2021
Otis wrote:
You don't show what you do on the server (i.e. where you construct the QueryParameters again). It might be a good idea to enable tracing to log what SQL is generated for your query. This allows you to see if the elements you passed are indeed reassembled properly to QueryParameters or that something's not passed properly. For how to enable tracing (you have to do that on the service side), see: Troubleshooting and debugging in the documentation. (this is for v5.8 but same information applies to older versions)
Hello Otis , sorry for the delay , i was working around the solution. passing the inner elements of QueryParameters.
- problem was that the value parameter filterBucket.SelectListAlias, didnt passed from client to server . and got that exception : An exception was caught during the execution of a retrieval query: ORA-00904: "LPLA_1"."KOD_EIRUA": Invalid Identifier. I solved this by initiate that value on server . filterBucket.SelectListAlias = "LPLA_1". now i am able to get the results for the grids and for other forms successfully, if you got an idea how to fix that without initiate it specifically i would prefer.
- For simple queries passing through the server is ok .but for complex queries I'm facing a similar problem with serialization.
now its DynamicRelation can't be serialized to XML. which is in thefilterBucket.Relations elements (type of DynamicRelation ).
this type coming from the generated DataAccess DLL and having the [Serializable] Attribute .
I dont understand why i get that Exception?
any idea?
thank you
here is the Full TraceLog :
TraceEventId 92b50336-4da7-4ad4-ad98-f27809d959bf TraceEventDescription DefaultEventDescription TimeStamp 17/03/2021 16:10:21 ProcessID 3644 Message <?xml version="1.0" encoding="utf-16"?><Exception handlingInstanceId="f17b9eee-4258-445d-9a70-abebf9931bab"><Description>An exception of type 'Ness.ISG.Client.Infrastructure.DataQueries.Exceptions.InfrastructureDataQueriesGetOperationException' occurred and was caught.</Description><DateTime>2021-03-17 16:10:21Z</DateTime><ExceptionType>Ness.ISG.Client.Infrastructure.DataQueries.Exceptions.InfrastructureDataQueriesGetOperationException, Ness.ISG.Client.Infrastructure.DataQueries, Version=5.1.0.2, Culture=neutral, PublicKeyToken=null</ExceptionType><Message>DataQueries get operation failed, see inner exception for details.</Message><Source>Ness.ISG.Client.Infrastructure.DataQueries</Source><HelpLink /><Property name="Data">System.Collections.ListDictionaryInternal</Property><Property name="TargetSite">Void FetchEntityCollection(SD.LLBLGen.Pro.ORMSupportClasses.QueryParameters)</Property><Property name="HResult">-2146232832</Property><StackTrace> at Ness.ISG.Client.Infrastructure.DataQueries.ClientDataAccessAdapter.FetchEntityCollection(QueryParameters parameters) in c:\GayaProjects\ProvidentFundsInfrastucture\OL-4.5.2\ProvidentFundsClient\Infrastructure\Ness.ISG.Client.Infrastructure.DataQueries\ClientDataAccessAdapter.cs:line 64 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProvider2.ExecuteEntityProjection(QueryExpression toExecute) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProProvider2.cs:line 101 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.ExecuteExpression(Expression handledExpression, Type typeForPostProcessing) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProProviderBase.cs:line 304 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.System.Linq.IQueryProvider.Execute(Expression expression) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProProviderBase.cs:line 890 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProQuery.cs:line 162 at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Ness.ISG.Client.Infrastructure.Controls.GridView.QueryExecutionService`1.<>c__DisplayClass18.<GetInitPageAsync>b__17() in c:\GayaProjects\ProvidentFundsInfrastucture\OL-4.5.2\ProvidentFundsClient\Infrastructure\Ness.ISG.Client.Infrastructure.Controls\GridView\QueryExecutionService.cs:line 85 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()</StackTrace><additionalInfo><info name="MachineName" value="WS-GUY" /><info name="TimeStamp" value="17/03/2021 14:10:21" /><info name="FullName" value="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /><info name="AppDomainName" value="Ness.ProvidentFunds.Client.Infrastructure.Shell.exe" /><info name="ThreadIdentity" value="MEHMAIL\025090523" /><info name="WindowsIdentity" value="MEHMAIL\025090523" /></additionalInfo><InnerException><ExceptionType>Ness.ISG.Client.Infrastructure.DataQueries.Exceptions.InfrastructureDataQueriesGetOperationException, Ness.ISG.Client.Infrastructure.DataQueries, Version=5.1.0.2, Culture=neutral, PublicKeyToken=null</ExceptionType><Message>DataQueries get operation failed, see inner exception for details.</Message><Source>Ness.ISG.Client.Infrastructure.DataQueries</Source><HelpLink /><Property name="Data">System.Collections.ListDictionaryInternal</Property><Property name="TargetSite">Void FetchEntityCollection(SD.LLBLGen.Pro.ORMSupportClasses.QueryParameters)</Property><Property name="HResult">-2146232832</Property><StackTrace> Server stack trace: at Ness.ISG.Client.Infrastructure.DataQueries.ClientDataAccessAdapter.FetchEntityCollection(QueryParameters parameters) in c:\GayaProjects\ProvidentFundsInfrastucture\OL-4.5.2\ProvidentFundsClient\Infrastructure\Ness.ISG.Client.Infrastructure.DataQueries\ClientDataAccessAdapter.cs:line 64 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProvider2.ExecuteEntityProjection(QueryExpression toExecute) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProProvider2.cs:line 101 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.ExecuteExpression(Expression handledExpression, Type typeForPostProcessing) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProProviderBase.cs:line 304 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.System.Linq.IQueryProvider.Execute(Expression expression) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProProviderBase.cs:line 890 at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Linq\LLBLGenProQuery.cs:line 162 at System.Linq.SystemCore_EnumerableDebugView`1.get_Items() Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Ness.ISG.Common.Infrastructure.DataQueries.IDataQueriesContract.Get(TypeInfo entityType, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) at Ness.ISG.Client.Infrastructure.DataQueries.ClientDataAccessAdapter.FetchEntityCollection(QueryParameters parameters) in c:\GayaProjects\ProvidentFundsInfrastucture\OL-4.5.2\ProvidentFundsClient\Infrastructure\Ness.ISG.Client.Infrastructure.DataQueries\ClientDataAccessAdapter.cs:line 57</StackTrace><InnerException><ExceptionType>System.NotSupportedException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>DynamicRelation can't be serialized to XML</Message><Source>mscorlib</Source><HelpLink /><Property name="Data">System.Collections.ListDictionaryInternal</Property><Property name="TargetSite">Void HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage)</Property><Property name="HResult">-2146233067</Property><StackTrace> Server stack trace: at SD.LLBLGen.Pro.ORMSupportClasses.DynamicRelationBase.SD.LLBLGen.Pro.ORMSupportClasses.IRelation.WriteXml(XmlWriter writer) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\QueryApiElements\DynamicRelationBase.cs:line 301 at SD.LLBLGen.Pro.ORMSupportClasses.RelationCollection.WriteXml(XmlWriter writer) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\QueryApiElements\RelationCollection.cs:line 1434 at SD.LLBLGen.Pro.ORMSupportClasses.RelationPredicateBucket.WriteXml(XmlWriter writer) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v5.7\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\QueryApiElements\RelationPredicateBucket.cs:line 179 at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteIXmlSerializable(XmlWriterDelegator xmlWriter, Object obj, XmlSerializableWriter xmlSerializableWriter) at System.Runtime.Serialization.XmlDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context) at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph, DataContract contract, Hashtable surrogateDataContracts) at System.Runtime.Serialization.NetDataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph) at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter writer, PartInfo part, Object graph) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameters(XmlDictionaryWriter writer, PartInfo[] parts, Object[] parameters) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, MessageVersion version, String action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer) at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer) at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer) at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota) at System.ServiceModel.Channels.MtomMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset, String startInfo, String boundary, String startUri, Boolean writeMessageHeaders) at System.ServiceModel.Channels.MtomMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset) at #gc.#Ce.#m.#De.WriteMessage(Message , Int32 , BufferManager , Int32 ) at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message, Boolean shouldRecycleBuffer) at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at #gc.#Xc.#m.#Yc.#ap(Message , TimeSpan ) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Ness.ISG.Common.Infrastructure.DataQueries.IDataQueriesContract.Get(TypeInfo entityType, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) at Ness.ISG.Client.Infrastructure.DataQueries.DataQueriesProxy.Get(TypeInfo entityType, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) in c:\GayaProjects\ProvidentFundsInfrastucture\OL-4.5.2\ProvidentFundsClient\Infrastructure\Ness.ISG.Client.Infrastructure.DataQueries\DataQueriesProxy.cs:line 24 Exception rethrown at [1]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Ness.ISG.Common.Infrastructure.DataQueries.IDataQueriesContract.Get(TypeInfo entityType, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields, Int32 pageNumber, Int32 pageSize) at Ness.ISG.Client.Infrastructure.DataQueries.ClientDataAccessAdapter.FetchEntityCollection(QueryParameters parameters) in c:\GayaProjects\ProvidentFundsInfrastucture\OL-4.5.2\ProvidentFundsClient\Infrastructure\Ness.ISG.Client.Infrastructure.DataQueries\ClientDataAccessAdapter.cs:line 57</StackTrace></InnerException></InnerException></Exception> ThreadID 1
Joined: 21-Aug-2005
I believe it's better that you provide a short simple repro solution, so we can test it. You may build it on top of Northwind for simplicity. Zip the code files excluding any binaries and attach it to your reply message.
Joined: 17-Aug-2003
SelectListAlias is a member used by the internals for e.g. nested queries, so it's not a higher-level directive for the query. What you should do is send the information over the wire to build the query on the server, you're at a level that's too low. I know what you're trying to do, but really you're better off with a service that accepts parameters and making the client in fact 'dumber'. What you're trying to do isn't supported as a use case as you're effectively trying to serialize the inner workings of the dataaccessadapter over the wire and it's not designed for that.
The main differences with older versions is that e.g. in a linq query or queryspec query it can result in multiple queries being executed on the database, all this info is now bundled in 1 object, the QueryParameters. As this object is for internal use, it's not serializable. This isn't going to change in the future.
I suggested you to send the predicates/relationcollections directly as I assumed the queries you constructed were simple as they worked in the older version as well. However I think that was premature, the queries can be more complex and therefore you do run into a limitation in that.
There might be another way however, in that you generate the SQL+parameters on the client and send that over the wire, execute that on the server, and send the results back. this might require custom code in the adapter but it's worth a shot perhaps? E.g. the method adapter.ExecuteMultiRowRetrievalQuery receives the generated query and the elements to fill. Before you jump to conclusions: these aren't serializable, but you can use these to tell the server counterpart what to do, e.g. send the sql over and custom elements you design so it knows what to do (type names, whatever). Your app relies on the internal workings of our system and these changed, so it's up to you to adapt your app to these changes.