serialization

How triggers behave wrt concurrent visibility of transactions?

I'm working on PostgreSQL 8.4 in read committed mode. I know that for each query, the server makes a snapshot of db state so that the query behaves consistently. Does it include triggers that are called in response to this query? Or is there a new snapshot created for each query called from within a trigger? ...

[ActionScript 3] Array subclasses cannot be deserialized, Error #1034

I've just found a strange error when deserializing from a ByteArray, where Vectors cannot contain types that extend Array: there is a TypeError when they are deserialized. TypeError: Error #1034: Type Coercion failed: cannot convert []@4b8c42e1 to com.myapp.ArraySubclass. at flash.utils::ByteArray/readObject() at com.myapp::MyAp...

How to enforce xml serialization through an interface?

Currently i have some interfaces (stripped down for here): public interface IJobGroup { string Name { get; } IEnumerable<IJobItem> Jobs { get; } } public interface IJobItem { string Name { get; } void Start(); event EventHandler Finished; } Also i made some implementations of these interfaces. But now i'd like to ...

I serialized a C++ object, how to allocate memory for it without knowing what type it is?

Hello, I have serialized a C++ object and I wish to allocate space for it, although I can't use the "new" operator, because I do not know the object's class. I tried using malloc(sizeof(object)), although trying to typecast the pointer to the type the serialized object is of, the program shut down. Where is the information about the obje...

Unit testing with serialization mock objects in C++

Greetings, I'm fairly new to TDD and ran across a unit test that I'm not entirely sure how to address. Basically, I'm testing a couple of legacy class methods which read/write a binary stream to a file. The class functions take a serializable object as a parameter, which handles the actual reading/writing to the file. For testing this...

Is PHP serialize function compatible UTF-8 ?

I have a site I want to migrate from ISO to UTF-8. I have a record in database indexed by the following primary key : s:22:"Informations générales"; The problem is, now (with UTF-8), when I serialize the string, I get : s:24:"Informations générales"; (notice the size of the string is now the number of bytes, not string length) So...

Serializing classes in C#. nested XML

Hi All, I have to generate XML in the below format <objects> <items> <item ="delete"> <searchfields> <searchfield name="itemname" value="itemValue" /> </searchfields> </item> </items> </objects> So I have generated the CS file using xsd.exe by converting the above XML to XSD. xsd.exe -c -l:c# -n:XmlSerializationDeleteObj...

Why are a couple of our users getting "System.InvalidOperationException: <html xmlns=''> was not expected."?

Amongst other things, our software connects to an online store. Part of the process downloads a catalogue of the products to preview in the software. Some of our users are having problems using the store and this seems to stem from this error in the logs: System.InvalidOperationException: There is an error in XML document (2, 2). ---> S...

How to deserialize null array to null in c#?

Here is my class: public class Command { [XmlArray(IsNullable = true)] public List<Parameter> To { get; set; } } When I serialize an object of this class: var s = new XmlSerializer(typeof(Command)); s.Serialize(Console.Out, new Command()); it prints as expected (xml header and default MS namespaces are omitted): <Command><To...

Serializing a part of object graph

Hi all, I have a problem regarding Java custom serialization. I have a graph of objects and want to configure where to stop when I serialize a root object from client to server. Let's make it a bit concrete, clear by giving a sample scenario. I have Classes of type Company Employee (abstract) Manager extends Employee Secretary extends...

XmlSerializer (c#) reports There was an error reflecting type (type = List<myclass> )

Hi there, Can anyone help? I have a method for converting an object to a dataset. In this case the object is a collection (using LIST) of a a collection class Here is the code but it errors with the following error on the line XmlSerializer formatter= ... This is the error There was an error reflecting type 'System.Collections.Gener...

PHP - *fast* serialize/unserialize?

I have a PHP script that builds a binary search tree over a rather large CSV file (5MB+). This is nice and all, but it takes about 3 seconds to read/parse/index the file. Now I thought I could use serialize() and unserialize() to quicken the process. When the CSV file has not changed in the meantime, there is no point in parsing it agai...

asp.net not deserializing soap response

Hi all, I have been given a wsdl and have used wsdl.exe to create my proxy classes. I am able to call the function to initiate the request with some valid parameters and this returns my response object which is always EMPTY. When i inspect the soap message response using fiddler the soap does have valid data that should be deserialze...

Changing what a property is serialized as

I think i already know the answer to this, but i cannot find anything that states it definitively, hence my question - i want to make sure i am not missing a trick. Using the DataContractSerializer or the XmlSerializer, is there any way to change what a pulic property is serialized as? I have a property that is an Enum, and i would lik...

Is it possible to store controls(Panel) as object, serialize it and store it as a file?

The topic says it all. Using Compact Framework C# I'm tiling (order/sequence is important) some images that i download from an url, into a Panel(each image is a PictureBox). This can be a huge process, and may take some time. Therefor i only want the user to download the images and tile them once. So the next time the user uses the ...

How can I marshal a hash with arrays?

What should I do to marshal an hash of arrays? The following code only prints {}. s = Hash.new s.default = Array.new s[0] << "Tigger" s[7] << "Ruth" s[7] << "Puuh" data = Marshal.dump(s) ls = Marshal.restore( data ) p ls If the hash doesn't contain an array it is restored properly. ...

Deserialization Failure - C#

I've written some code which is a mini simple imitation of messenger program. In the program; when the user signs out, instance of my LogOutCommand class is prepared by client program, serialized, and sent to server. When the server receives the LogOutCommand, it deserializes and invokes Execute method of the class, which performs db ope...

Deserializing JSON into an object with Json.NET

Hello. I'm playing a little bit with the new StackOverflow API. Unfortunately, my JSON is a bit weak, so I need some help. I'm trying to deserialize this JSON of a User: {"user":{ "user_id": 1, "user_type": "moderator", "creation_date": 1217514151, "display_name": "Jeff Atwood", ... "accept_rate": 100 }} ...

Q on Python serialization/deserialization

What chances do I have to instantiate, keep and serialize/deserialize to/from binary data Python classes reflecting this pattern (adopted from RFC 2246 [TLS]): enum { apple, orange } VariantTag; struct { uint16 number; opaque string<0..10>; /* variable length */ } V1; struct { uint32 number; opaqu...

ASP.Net MVC - how can I easily serialize query results to a database?

I've been working on a little property search engine while I learn ASP.Net MVC. I've gotten the results from various property database tables and sorted them into a master generic property response. The search form is passed via Model Binding and works great. Now, I'd like to add pagination. I'm returning the chunk of properties for ...