You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by ivasilinets <iv...@gridgain.com> on 2015/06/02 10:38:47 UTC

Re: How to use CacheJdbcBlobStore? Getting NotSerializableException

Hi!

1. Jdk marshaller is used only to check configuration. 

2. Cache store factory should be serializable in cache configuration.
FactoryBuilder$SingletonFactory save the instance of the underlying object,
so you can use only serializable stores with it. CacheJdbcBlobStore is not
serializable. You need to implement your own factory to use
CacheJdbcBlobStore. 

To implement your own factory please override method Factory.create() 
 @Override public CacheJdbcBlobStore create() {
        CacheJdbcBlobStore store = new CacheJdbcBlobStore();

       //Please set only parameters that you need. To use default
configuration, write only return new CacheJdbcBlobStore();

        store.setInitSchema(initSchema);
        store.setConnectionUrl(connUrl);
        store.setCreateTableQuery(createTblQry);
        store.setLoadQuery(loadQry);
        store.setUpdateQuery(updateQry);
        store.setInsertQuery(insertQry);
        store.setDeleteQuery(delQry);
        store.setUser(user);
        store.setPassword(passwd);
        store.setDataSource(dataSource);

        return store;
}

I hope my answer helps you.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-use-CacheJdbcBlobStore-Getting-NotSerializableException-tp431p438.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.