Saving and reading serialized data from/into db