[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: william  XML
Profile for william -> Messages posted by william [4]
Author Message

gbevin wrote:
You could work around it as follows, note that I haven't tried this out with an example, but it should work. The version numbers in the instructions are for the latest and greatest of everything, adapt accordingly if you need it.

1. get the binary version of the ehcache tim from http://forge.terracotta.org/releases/downloads/tim-ehcache/tags/release-1.1.2/
2. unzip the archive:
Code:
unzip tim-ehcache-1.1.2-bin.zip

3. go into the archive directory:
Code:
cd tim-ehcache-1.1.2

4. extract the terracotta configuration file for the TIM:
Code:
unzip tim-ehcache-1.3-1.1.2.jar terracotta.xml

5. edit the configuration file, find the snippet below and remove it:
Code:
     <root>
       <field-name>net.sf.ehcache.CacheManager.ALL_CACHE_MANAGERS</field-name>
     </root>
     <root>
       <field-name>net.sf.ehcache.CacheManager.singleton</field-name>
     </root>

6. save the configuration file
7. put it back into the TIM:
Code:
zip tim-ehcache-1.3-1.1.2.jar terracotta.xml

8. put the new TIM jars in the modules directory of your Terracotta installation (make sure that none of the old TIM jars are there anymore)
Code:
mv tim-ehcache-*.jar $TC_INSTALL_DIR/modules


What you did here is make none of the caches and the cache managers shared. So instead of having all of them being shared, you can now cherry pick the ones that should be shared for your use case.

To do this, you could work with different CacheManager instances or even different Cache instances I think. The ones that are shared should be put into a collection field, or individual fields of one of your application classes. You should then adapt your tc-config.xml file to include those fields as shared Terracotta roots.

Let me know how this goes.

Take care,

Geert 


Hi gbevin, I have used your example to my work. It is worked. Thanks a lot your detailed example! Thank you very much!

Hi, guys, thanks a lot for reply me. I was filed the JIRA.

Now I will try use another cache like JBossCache to solute this issue.

Thanks,
Best Regards.
------------------- ______--------------------
Project1 _______________Project2
------------------- ______ --------------------
Cache A
----------------------------------------------------
______ TC Cache B


I used the TC ehcache for my project1 & 2( like the pic), and the Cache B is the shared cache. But Cache A is only for project1. When the project1 used Cache A.

I got the error:
"com.tc.exception.TCNonPortableObjectError"
<instrumented-classes>
<include>
<class-expression>xxx.xxx.xxx</class-expression>
</include>
</instrumented-classes>

I do not want to let Cache A to be shared.
How can I do? Thanks
------------------- ______--------------------
Project1_______________Project2
------------------- ______ --------------------
Cache A
----------------------------------------------------
______ TC Cache B


I used the TC ehcache for my project1 & 2( like the pic), and the Cache B is the shared cache. But Cache A is only for project1. When the project1 used Cache A.

I got the error:
"com.tc.exception.TCNonPortableObjectError"
<instrumented-classes>
<include>
<class-expression>xxx.xxx.xxx</class-expression>
</include>
</instrumented-classes>

I do not want to let Cache A to be shared.
How can I do? Thanks
 
Profile for william -> Messages posted by william [4]
Go to:   
Powered by JForum 2.1.7 © JForum Team