Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> Serialization Problem over WCF
 

Pages: 1
Bugs & Issues
Serialization Problem over WCF
Page:1/1 

  Print all messages in this thread  
Poster Message
piscario
User



Location:

Joined on:
11-Mar-2010 14:32:57
Posted:
6 posts
# Posted on: 11-Mar-2010 15:54:05.  
Hi there

I have a problem with an Entity that is getting its IsDirty property set to true after it is being deserialized by WCF. This is causing problems on saving as the Entity isn't dirty and should not be saved as we have a permission model that allows read only viewing of certain records.

Basically we have a collection of roles on a Contact and it is these roles that are having the Dirty flag reset. When the Contact entity is saved we set to save related entities and if the user does not have permission for any of these we make sure that the related collections will not be saved by checking what would be updated on the server. The databse has Triggers that are the last defense against unpermitted updates.

There is no custom properties or serialization and we are using wsHttpBinding on WCF.

No Properties or Collections on the Role are Dirty with the exception of the related Contact being saved.

It seems that no other properties on the contact role have changed other than IsDirty.

We are running genpro 2.6 final.

Any thoughts on why this would be happening. Help appreciated
  Top
MTrinder
Support Team



Location:
London by day, Milton Keynes by night.
Joined on:
08-Oct-2008 17:55:47
Posted:
994 posts
# Posted on: 11-Mar-2010 21:17:41.  
If you debug through the process can see where/when the flags change to IsDirty ?

Can you tell which property IsChanged...?

Matt


  Top
piscario
User



Location:

Joined on:
11-Mar-2010 14:32:57
Posted:
6 posts
# Posted on: 12-Mar-2010 11:11:20.  
On the Client before WCF serialization

Contact.ContactRoles.ContainsDirtyContents= false
Contact.ContactRoles[0].IsDirty = false

On the Server after deserialzation

Contact.ContactRoles.ContainsDirtyContents= true
Contact.ContactRoles[0].IsDirty = true

When the ContactRole entity is saved it is only saving the ContactId to the database. This field has not changed in anyway on the client.

We dont explictly prefetch the contact roles on the contact because of how our application works we rather AddRange to the Collection when needed. This does set IsDirty = true for the ContactRoles which we manually change back to false.

Does this internaly set that the ContactId on the ContactRole has changed because it is a FK. We have other Entities that work in this was but we are not getting the IsDirty Deserialization problems.
  Top
Walaa
Support Team



Location:
Egypt
Joined on:
21-Aug-2005 16:03:48
Posted:
9817 posts
# Posted on: 12-Mar-2010 11:24:13.  
Doing:
Code:
myContact.ContactRoles.Add(myContactRole);

myContactRole's FK to COntact will be set, and thus the entity would be dirty.


LLBLGen Training
http://www.linkedin.com/in/walaa
 
Top
piscario
User



Location:

Joined on:
11-Mar-2010 14:32:57
Posted:
6 posts
# Posted on: 12-Mar-2010 11:34:50.  
Walaa wrote:
Doing:
Code:
myContact.ContactRoles.Add(myContactRole);

myContactRole's FK to COntact will be set, and thus the entity would be dirty.


Thats why we manually set it back to false as the state it is on when we get the Roles a while after the Contact is essentially not Dirty. We have just got the collection from the DB and at this point in time it will represent what is in the ContactRole Table

It is only on the Deserialization that it gets set back to true and as nothing has really changed we dont want any updates to happen on the row. The ContactId on the ContactRole is the same.
  Top
Walaa
Support Team



Location:
Egypt
Joined on:
21-Aug-2005 16:03:48
Posted:
9817 posts
# Posted on: 12-Mar-2010 11:41:18.  
Which exact runtime library build (number) are you using?

LLBLGen Training
http://www.linkedin.com/in/walaa
 
Top
piscario
User



Location:

Joined on:
11-Mar-2010 14:32:57
Posted:
6 posts
# Posted on: 12-Mar-2010 11:54:46.  
In RuntimeLibraries\DotNET35

SD.LLBLGen.Pro.ORMSupportClasses.CF35.dll
File Version 2.6.0.0
Assembly Version 2.6.0.0

All the Dll's in the LLBLGen Pro v2.6 folder are 2.6.0.0
  Top
Walaa
Support Team



Location:
Egypt
Joined on:
21-Aug-2005 16:03:48
Posted:
9817 posts
# Posted on: 12-Mar-2010 12:01:41.  
I need that of the one used in the server side for deserialization.
(SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll)


LLBLGen Training
http://www.linkedin.com/in/walaa
 
Top
piscario
User



Location:

Joined on:
11-Mar-2010 14:32:57
Posted:
6 posts
# Posted on: 12-Mar-2010 12:06:47.  
Sorry

File Verison 2.6.8.709
Assembly Version 2.6.0.0
  Top
Walaa
Support Team



Location:
Egypt
Joined on:
21-Aug-2005 16:03:48
Posted:
9817 posts
# Posted on: 12-Mar-2010 12:14:05.  
Quote:
File Verison 2.6.8.709

That's almost 2 years old, would you please try using the latest build before we dig deep on this.

Thanks.


LLBLGen Training
http://www.linkedin.com/in/walaa
 
Top
piscario
User



Location:

Joined on:
11-Mar-2010 14:32:57
Posted:
6 posts
# Posted on: 12-Mar-2010 13:17:17.  
This isnt something I can do in the next few days so I will have to get back to you next week.

I will have to implement a workaround in the mean time so that we dont save the contact roles we shouldn't.

Thanks
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
3995 posts
# Posted on: 13-Mar-2010 04:43:11.  
We will wait for your reply...

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.