Hey all, I work for Terracotta and I'm going to work on building some 
pre-packaged Terracotta integration for Joda Time.  It's a great library and 
one we'd like to support out of the box.  I'm still coming up to speed on the 
issues on this thread so bear with me.

>From Johannes's last post on the subject, he said:
" Now there exist three approaches to solve that issue:
 - Don't compare objects using ==. I know that this is not perfect, but
 for me it was a very simple solution... But ok, I think that is not the
 way to go.
 - Share the static fields: I tried this successfully. But of course the
 performance is very, very poor. Every time a static field of
 DateTimeFieldType is accessed, that field is locked in the hole cluster.
 So obviously this is not a possible solution.
 - Reinitializing the date time objects: It is possible to call methods
 or execute bean shell code, when an object is transferred to another
 VM."

I think this is a good place to start.  I'll take these by #:
1) Terracotta does track object identity so #1 should not be a problem.  I 
agree with Stephen that the lib shouldn't need to change.  The whole point of 
Terracotta is to make things like this work.  For other clustering 
technologies, they largely rely on serialization so they're likely fine 
assuming JT objects serialize/deserialize correctly, which I'll bllindly 
assume.  
2) This is one possible approach and may be the easiest if not fastest 
solution.  I noticed in your prior locking however that you were using write 
locks for getters.  I haven't looked at the source yet.  It may be that this is 
necessary due to some lazy init or something but generally, read locks will 
improve performance quite a bit there.
3) I think this is likely the best approach.
4) I'll add a 4th approach which is to doing some byte code modification on 
these classes to alter their behavior slightly in the cluster.  I have no idea 
yet if that's necessary.  Generally, we try to avoid that as it makes the 
Terracotta integration more sensitive to version and code changes (plus it's 
just more work). :)

I have the sample app from the Terracotta forum too so I'll start with that.  

I'll let you know what I come up with!  Feel free to email me at this address 
or amiller#terracottatech.com directly too.

Alex Miller




-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Joda-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to