I need a way to use custom serialization (kryo based) only for a certain H2 db, while other dbs (on the same JVM instance) should continue using standard serialization. I've seen some time ago a guy asked something similar <http://h2-database.66688.n3.nabble.com/Serialized-vs-not-serialized-objects-and-system-property-td4024656.html> but no patches followed. The possibility to control serialization per-database is useful especially when you have no full control on jvm system properties (e.g. with web containers).
So patch.txt <http://h2-database.66688.n3.nabble.com/file/n4026990/patch.txt> is a raw proposal that would let me benefit from the performance improvements I depicted in a previous post <http://h2-database.66688.n3.nabble.com/Any-chance-to-achieve-better-performances-for-OTHER-columns-through-jboss-serialization-library-tp4026037p4026809.html> . Some implementation notes: * changes are quite invasive: I exposed the /JavaObjectSerializer/ eventually specific to the particular db through /ConnectionInfo/ in order to make java object value holder classes operate on a per-db basis. OTOH I've not figured out any other minimal way to achieve per-db serialization. * I added the new optional database-level setting /JAVA_OBJECT_SERIALIZER/ (default: null) in order to specify the FQN of JavaObjectSerializer implementation used to (de)serialize columns of type OTHER. * I overloaded /Utils.serialize()/ with a signature that accepts an optional /ConnectionInfo/ and I supposed to deprecate the older signature. The same stands for deserialization. * The serialization still depends on the value of /SysProperties.serializeJavaObject/ (a system property). Maybe it could be masked by an ad-hoc new database-level setting... * I adapted the existing tests and added /TestPerDbJavaObjectSerializer/ Cheers Davide -- View this message in context: http://h2-database.66688.n3.nabble.com/Database-level-custom-serialization-for-columns-of-type-OTHER-patch-proposal-tp4026990.html Sent from the H2 Database mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/groups/opt_out.
