-
1. Re: A problem with Java 1.5 enum replication
ben.wang Oct 21, 2005 12:36 AM (in response to roginsky)To answer you questions:
1. Enum is a Java class that we are not supposed to instrument and intercept. So I need to think of a solution when we support 1.5 officially in release 1.3. Can you please open up an Jira issue (jira.jboss.com) under JBCACHE (with component aop)?
2. If you are using DummyTX, then you can also change the Manager class to DummyTransactionManagerClass.
-Ben -
2. Re: A problem with Java 1.5 enum replication
roginsky Oct 21, 2005 1:39 AM (in response to roginsky)Thank you Ben!
1) Before I go to JIRA, let me make sure we understand each other. I forgot to clearly mention in my previous e-mail that we don't instrument our classes currently. They are just Serializable. So in this case does the fact that you are not intercepting the enum field itself still matter?
Also, the change is reflected correctly in the local cache, it's just the replication to the other node in the cluster that doesn't happen.
2) Actually I want to use JBossTransactionManagerLookup, but I didn't find any examples in the docs how should I create my transaction in this case.
By the way, do I really need to use JBossTransactionManagerLookup? What would you recommend?
Again, many thanks for all your help.
Renata. -
3. Re: A problem with Java 1.5 enum replication
ben.wang Oct 21, 2005 11:15 AM (in response to roginsky)OK, so if you are not instrumenting your Pojos that mean you are not using TreeCacheAop. In that case, you will need to do an explicit cache.put(...) after each modification for it to replicate. This is way to do it in plain cache.
-Ben -
4. Re: A problem with Java 1.5 enum replication
jpyorre May 12, 2006 9:09 AM (in response to roginsky)Any progress on enum replication so far?
I am currently using a quick fix on "CachedType.java", because enums didn't work when I loaded them back using a cache loader. The fix simply considers enumerators as immediates (added code in bold):public static boolean isImmediate(Class clazz) { return immediates.contains(clazz) || isEnumerator(clazz); } public static boolean isEnumerator(Class clazz) { return Enum.class.isAssignableFrom(clazz); }
Seems to work fine at least locally (I have not tested cluster-wide replication).
I have no idea how enums are serialized, but if its just the ordinal thats serialized then this solution should always work and in that case there is no point in instrumenting the enum anyhow.
Regards,
Jussi Pyörre -
5. Re: A problem with Java 1.5 enum replication
ben.wang May 14, 2006 10:12 PM (in response to roginsky)Enumerator is Serialzable so you should not have to patch CachedType though?
I have created a Jira:
http://jira.jboss.com/jira/browse/JBCACHE-619
You can subscribe to watch it.
I am scheduling it for 2.0 which is about 3 months away.