On 2013-08-02 12:31, davide.cavestro wrote:
Hi Noel, I ventured into implementing the /JAVA_OBJECT_SERIALIZER/ command...
just to try :-).
So I would end up with three ways to set a serializer:
1. at jvm level
2. at db level through the jdbc url
3. at db level in a persistent way through the /SET JAVA_OBJECT_SERIALIZER/
command.
That makes sense to me, as it covers various scenarios.
1. is the existing flag, so we need to keep that.
2. and 3. are the way a lot of the current options work, so that is good.

Now, I just wonder how a property set into the JDBC url can be exposed
through the/ConnectionInfo.getDbSettings()/ implementation that actually
does the following

I suspect this way a well known property set through the JDBC url will never
be added to the /s/ map, hence will never appear within the returned
/DbSettings/ instance. Is it a bug? Please correct if I am wrong.
Have a look at how CACHE_SIZE works.
It can set either on the URL or using a SET CACHE_SIZE command.
And it is initialised in the org.h2.engine.Database constructor, which is how this feature should be working - it should read the name of the ObjectSerializer, and if it is non-null, it should resolve the class via Class.forName at this point in time.


In the meantime I developed the code that exposes to the /RemoteSession/ the
/JAVA_OBJECT_SERIALIZER/ value eventually set into the database. It issues a
"SELECT * FROM INFORMATION_SCHEMA.SETTINGS" query to the server, extracting
the appropriate value. Is it adequate?

Yes.
Have a look at the JdbcDatabaseMetaData#getMode() and JdbcConnection#getQueryTimeout methods.
They do similar things.

You should probably be reading the setting in the SessionRemote#connectServer method.

--
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 h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to