createCache fails in non-static method

2015-08-28 Thread endian675

I am creating a cache with a CacheStoreFactory implementation and a
CacheStoreSessionListener. If I set the CacheConfiguration with these fields
and then call createCache but in an INSTANCE method I get this exception:


Exception in thread main javax.cache.CacheException: class
org.apache.ignite.IgniteCheckedException: Failed to validate cache
configuration (make sure all objects in cache configuration are
serializable): LongCache

In a static method, this does not occur. This can be easily reproduced by
modifying the CacheJdbcStoreExample.java in examples. This is happening
under Ignite 1.30
 



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/createCache-fails-in-non-static-method-tp1186.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Can anyone hear me?

2015-08-28 Thread Denis Magda

Yeap, you're not alone here. Subscribed successfully.

On 8/28/2015 11:39 AM, endian675 wrote:

Subscribing to this list is really too awkward, multiple steps that don't
seem to work as described.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Can-anyone-hear-me-tp1185.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.




Re: Query performance

2015-08-28 Thread javadevmtl
Cool I let you know about performance.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Re-Query-performance-tp1009p1192.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: createCache fails in non-static method

2015-08-28 Thread vkulichenko
Hi!

Most likely you declared the factory or the listener as an anonymous class.
Anonymous classes always contain reference to the parent class (LongCache in
your case). So if the factory is serialized in the context of LongCache
instance, this instance is also serialized. In case of static method this
instance doesn't exist, therefore everything works.

I would recommend to convert anonymous classes to private static classes.
This will give you more control on what is serialized.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/createCache-fails-in-non-static-method-tp1186p1196.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: put same key

2015-08-28 Thread Alexey Goncharuk
Yes, that is correct.

2015-08-28 13:13 GMT-07:00 javadevmtl java.dev@gmail.com:

 So with transactions, if 2 threads try to read/write, the first thread that
 gets a lock will  block the other thread? And once the first thread
 finishes
 the second 1 will continue as normal?





 --
 View this message in context:
 http://apache-ignite-users.70518.x6.nabble.com/put-same-key-tp1193p1201.html
 Sent from the Apache Ignite Users mailing list archive at Nabble.com.