serialization

Java flag to enable extended Serialization debugging info

i am currently struggling with HTTP Session replication on tomcat with complex objects. some objects implement Serializable but hold non-serializable members. unfortunately, the stacktraces do not provide much useful info here by default. there is a flag -XX:???? to enable verbose class names in the stacktrace when a NotSerializableEx...

setAttribute: Non-serializable attribute (Java Object Serialization)

We just switched to Glassfish V2. We are now getting errors when setting a session attribute. Error is: java.lang.IllegalArgumentException: PWC2788: setAttribute: Non-serializable attribute Code is: getRequest().getSession().setAttribute("questionsForUser", getQuestions()); getQuestions() is just a simple getter which is inside a...

.net Binary Serialization - Opt In

I am doing Binary Serilization of big nested data structure. Whenever [Serilizable] attribute is added to class, all the members are automatically serialized. I want to specifically select the fields that need to be serialized. As of now i am using [NonSerialized] Attribute for fields to opt out from serilization. Is there any way i can...

Class Design: Serialize Within Domain Object or Helper Class

Lets say I have some domain objects that will need to be serialized/packed using a custom binary format so they can be sent over sockets to external processes. My first instinct would be to create an interface that represents any object that can be packed into this binary format. public interface IPackable { byte[] Pack(); } Then...

Java Hashtable and serialization

Hi .. I have a problem in Java hashtable serialization that seems illogical to me but i am not able to find out the error in the logic i am using. Here is what i am doing, Hashtable sspsrpData = new Hashtable(); for(int i=0;i<Constants.secondayStructures.length;i++) { SecondaryStructures ss = (SecondaryStructures)(data.get(Constant...

Why does SerializationInfo not have TryGetValue methods?

When implementing the ISerializable interface in C#, we provide a constructor which takes a SerializationInfo object, and then queries it with various GetInt32, GetObject etc. methods in order to fill the fields of the object which we are trying to deserialize. One major reason to implement this interface, rather than just using the [S...

Boost Serializing of Object containing Map (with object values) and Multimap (with std::string values): what is needed?

See below a main() and two very simple classes. Then per Boost serialization (and what is shown) my questions are: 1) Does class B need the normal overloaded stream insertion operators '<<' and '>>' to be defined? Currently in my real code it doesn't have these. 2) Does class A in the store() and load() methods need to iterate thro...

Can silverlight serialize annonymous objects?

Can silverlight 3 serialize annonymous objects? ...

WebOrb/Flex: How to call a method on a RemoteClass returned by a RemoteObject

I have a RemoteObject returning a 'Schedule' class. I've created a client side RemoteClass to map to it. All properties of the class instance are coming in fine. I just not clear on how I go about calling methods on the class. How would I call a setter on startdate? package classes.remote { [Bindable] [RemoteClass(alias...

NHibernate and WCF Serialization(Unidirectional)

Object graph for type '[type]' contains cycles and cannot be serialized if reference tracking is disabled. I have a simple class hierarchy setup using NHibernate as my persistence layer. For example: public class Parent { public virtual IList<Child> Children{get;set;} } public class Child { public virtual Parent Parent{get;se...

LinqToXml vs LinqToSql...

Trying to "thaw" serialized objects that have been stored in an XML file: In LinqToSQL, I can (with a suitably decorated class) do this type of thing: [Table(Name="Plants")] public class Plant { [Column(Name = "Id", IsPrimaryKey = true)] public int Id { get; set; } [Column(Name = "Genus")] public string...

How to do Ruby object serialization using JSON

I have a structure of simple container classes like so (in pseudo ruby): class A attr_reader :string_field1, :string_field2 ... end class B attr_reader: int_field3, :string_field4 ... end # C includes an instance of A and B class C attr_reader: :a_instance, :b_instance ... end Is there are simple way to de/serialize this...

Why we should perfer to store the serialized data not the raw code to DB?

Hi: If we have some code(a data structure) which should be stored in DB, someone always suggests us to store the serialized data not the raw code string. So I'm not so sure why we should prefer the serialized data. Give a simple instance(in python): we've got a field which will store a dict of python, like { "name" : "BMW", "catego...

Add DataMemberAttribute "on the fly"

I have some types which are generated by a web service reference. I want to serialize these objects using the DataContractJsonSerializer, so I need to add DataContract and DataMember attributes. Adding DataContract is no problem using partial classes. But the properties have no DataMember attributes, so I only get empty objects. Is there...

How to Deserialise Xml into a Dictionary<int,string> object?

Is it possible to Deserialize the following piece of XML into a Dictionary<int,string> object? XML: <Config> <DatabaseConnections> <Connection Name="Source Connection" Value="ConnectionStringValue" /> <Connection Name="Target Connection" Value="ConnectionStringValue" /> <DatabaseConnections> <Config> I have a class which ...

Web Part Manager - Personalization Blob Data Extraction

I am adding a Personalizable Attribute to my custom implementation of WebPart class. This will be used by the Web Part Manager while rendering web parts to zones. I need to inject this new attribute and it's value to the existing personalization data for all users. I could retrieve the byte array of the personalization data blob per us...

Serializing DB/2 Triggers

We have a requirement to process transactions as an ordered sequence. Transactions are initiated on system 'A' and written to a DB/2 table. A DB/2 trigger then forwards the transaction via MQSeries to system 'B' where the transaction is completed. The problem we are having is that a race condition is established because execution of the...

Appending to a serialized collection

I'm having a serialized array of some type. Is there a way to append new objects to this serialized array (in a serialized form) without the need to read the already saved collection into the memory? Example: I'm having in a file.xml, XML-serialized array of Entity containing 10^12 elements. I need to add another 10^5 elements to the s...

Should this bug be fixed?

I found a bug in the .Net framework yesterday and found that it is a known bug that won't be fixed. In short the bug is that a class that contains a field of the type IComparable can't be binary serialized and deserialized when an int (and possibly other binary types) are assigned to that field: [Serializable] public class Foo { pub...

Listview Serialization !

appreciate if anyone knows how to serialize a listview using vb.net ...