Saturday, 3 March 2012

Developer Diary - Flex, Hibernate & Serialisation

From 11th September 2011.
Been keeping busy learning all the ins and outs of Flex, Hibernate and the perils of serialisation!

I'm sure everyone else knows but you should never assume things will "just work". There is no magic hammer for all problems and deserialisation is definitely something to be careful with.

Anyway, long story short, once you define the relationships on your data, Hibernate can load your database rows into neat little collections. Problem is that these collections are custom ones built by Hibernate, such as the PersistanceMap.

The problem arises when you attempt to send these down the wire to a Flex front end. GaS3 cannot serialise Hibernate collections properly and all you get out of the other side are nulls :(

This bug must have taken me about 2 weeks on and off to get to the root of >.< I kept finding work arounds but I finally sat down the other day to try to understand it. Mission accomplished... So yay XD

Things can be rough when you try to learn multiple complex technologies on the job!

No comments:

Post a Comment