Remoting and relations

Oct 27, 2009 at 11:56 AM

Our application use remoting as base concept, i'm searching ORM framework for it.

In your examles Remotin and Remoting2 everithing is fine except not working lines:

 

           if (objectSet.Count > 0)
           {
               // Show all Orders connected to the first shipper.
               foreach (Order order in objectSet[0].Orders)
               {
                   Console.WriteLine("Order loaded: {0}", order);
               }
           }

 

if (objectSet.Count > 0)
{
    // Show all Orders connected to the first shipper.
    foreach (Order order in objectSet[0].Orders)
    {
        Console.WriteLine("Order loaded: {0}", order);
    }
}

objectSet[0].Orders on Client returns an empty list.
If i manage to execute same code on server, it returns about 20 rows.
Any ideas how to fix it?


 

 

Coordinator
Oct 29, 2009 at 3:25 AM

Hmmm... I haven't looked into this. What did you set as remoting channels?

Oct 29, 2009 at 6:29 AM

HttpChannel or TcpChannel. Not working on any.

Jun 24, 2010 at 4:54 AM

Any updates here?

Coordinator
Jun 25, 2010 at 2:09 AM

That's weird. Are you sure the connection is not closed between the requests?

Jun 26, 2010 at 9:09 AM

Yes! As i mentioned before other code works fine in this case.

Sep 22, 2010 at 5:53 AM
Edited Sep 22, 2010 at 5:54 AM

Hi!

I had the same problem. I looked through the code and found the solution. Although web tutorials don't mention it, to use Remoting you need to set ObjectContext.EnableRemotingSerialization property to true, e.g. (last line)

 

IStorage storage = /*storage initialization here*/
ObjectContext context = new ObjectContext(storage);
context.ConcurrencyManager = new Md5ConcurrencyManager();
context.EnableRemotingSerialization = true;

 

 

Coordinator
Sep 23, 2010 at 5:47 AM
Edited Sep 23, 2010 at 5:47 AM

Good catch. That property actually should do it for you, yes.

Opf3 would need a bit more documentation in some spots :(