serializing then deserializing then saving object doesn't save object

Posts   
 
    
mjcastillo
User
Posts: 10
Joined: 08-Feb-2007
# Posted on: 29-Oct-2007 23:18:27   

Hi, I have several entity collections that I am serializing to a file, then later I deserialize them. When I look at the deserialized collections, everything looks fine (all the entity objects are there with the properties set as you would expect. But then when I execute a "Save()" on the collections, or on each entity objects, the objects are not written to the database whose connection string I am using. The database tables in the DB I am connected to when writing are empty so the objects should have no problem getting written out. There are no exceptions, and the save() seems to run fine, but when I look at the table, there is no record inserted. Any ideas what might be going on, or what tests to run to help determine why no objects are being inserted? Thanks, Mike

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Oct-2007 05:00:30   

Hi Mike,

Could you please paste some relevant code where you serialize/deserialize entities? Also tell us your LLBLGen version and RuntimeLibraries version (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=7722)

David Elizondo | LLBLGen Support Team
mjcastillo
User
Posts: 10
Joined: 08-Feb-2007
# Posted on: 30-Oct-2007 06:26:02   

Hi David, Attached is the class that does the serialization and deserialization and resaving. So basically an instance of this class is created and when you call export, it does some queries that fill in a bunch of Collections that are stored as instance variables. Then the object itself is serialized. Later to import, you create one of these and give it the path of the exported file and call the import method. This desrializes one of these objects and then starts writing out all the objects in teh list of the deserialized objects by calling save(). So the two methods that make all this happen are hte import and export methods of this class. Just trace through those and you will see how it works. We are using LLBL 1.0.2005.1.final and the ORMSupportClasses dll is also the same version. 1.0.2005.1. Thanks, Mike

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 30-Oct-2007 11:25:38   

We are using LLBL 1.0.2005.1.final and the ORMSupportClasses dll is also the same version. 1.0.2005.1.

That's not the RTL version, please check the link posted by David, to know how to get the RTL version.

Most probably you are using an old version of the RTL, if so, would you please try using the latest version available?

Thanks.

mjcastillo
User
Posts: 10
Joined: 08-Feb-2007
# Posted on: 30-Oct-2007 17:33:35   

OK so decided tgo breakdown and just use hte latest stuff. So pointed LLBL at the DB, included all the entities, built a two class self-servicing proeject, generated and it won't build. Sorry for the side issue here, but why would a project get generated that include Validator classes, yet no validator classes were generated? So the error is that basically VisStudio can't find any of hte validator classes that must have been included in teh project file? Sorry for being ignorant about the new release, but I would have expected just a simple project to build when essentially just using the default settings. Thanks for the help, Mike

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Oct-2007 09:29:19   

Which version exactly did you use?

Did you use the latest build of v.1.0.2005.1? Or the latest of v.2.x? Cause there is a breaking change in the 2.x version that was mentioned in the docs:

Validator classes are no longer generated by default. You have to enable that task explicitly in the preset you're using. If you're NOT re-generating the validator classes (because for example you're not using them), you should remove the existing validator classes from the existing generated code.

mjcastillo
User
Posts: 10
Joined: 08-Feb-2007
# Posted on: 31-Oct-2007 16:10:29   

OK Got the validator stuff working. Now all my Guid fields don't seem to return Guids as they used to. Instead the type returned appears to be "System.Guid?" I searched the help for Guid? and even Guid and didn't find anything about what is happening here. Does the generated code not support Guids anymore, and what sort of type is 'Guid?'? Thanks, Mike

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Oct-2007 16:31:00   

"System.Guid?"

That's a nullable GUID.

Please provide more info about your setup. The RTL version you are using, the database type/version. The complete exception / error text. Code snippets.

Please refer to the following guidelines: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7722