Re: Scala object support in iBATIS 3

2009-12-31 Thread Chris Reeves
Thanks Clinton; for an excellent mapper that's well designed and for the pointers. Here is what I came up with for an object wrapper factory. I don't really like keeping it in static field on MetaObject, but I couldn't come up with anything better. I'm not entirely certain the xml configuration pa

Re: Possible race condition using org.apache.ibatis.cache.Cache#hasKey ?

2009-12-31 Thread Simone Tripodi
ROFL, I feel so nerd, I should restart learning _natural_ languages and having more social life :D HAPPY 2010!!! On Thu, Dec 31, 2009 at 7:53 PM, Clinton Begin wrote: > LOL... it was pseudocode in the middle of a sentence dude.  :-) > > > > On Thu, Dec 31, 2009 at 11:29 AM, Simone Tripodi > wrot

Re: Possible race condition using org.apache.ibatis.cache.Cache#hasKey ?

2009-12-31 Thread Clinton Begin
LOL... it was pseudocode in the middle of a sentence dude. :-) On Thu, Dec 31, 2009 at 11:29 AM, Simone Tripodi wrote: > Hi Clinton, > sure, I'll add the Jira ticket for this, but since here in Italy, > because of the timezone, started celebrating the new year, I'll do it > tomorrow :P > BTW,

Re: Possible race condition using org.apache.ibatis.cache.Cache#hasKey ?

2009-12-31 Thread Simone Tripodi
Hi Clinton, sure, I'll add the Jira ticket for this, but since here in Italy, because of the timezone, started celebrating the new year, I'll do it tomorrow :P BTW, I discourage the use of the test value == Cache.NULL_OBJECT but rather Cache.NULL_OBJECT.equals(vaue) I had to patch iBatis 2 (and

Re: Possible race condition using org.apache.ibatis.cache.Cache#hasKey ?

2009-12-31 Thread Clinton Begin
PS: I just had a look, and I doubt there's any chance of a race condition here... there's only two usages of hasKey(). One is thread local, and the other uses a read/write lock scope. That said, I think your point about performance is perfectly warranted, and quite simple to solve. For example:

Re: Possible race condition using org.apache.ibatis.cache.Cache#hasKey ?

2009-12-31 Thread Clinton Begin
Good points. I think the only reason hasKey exists is to support cached null values. But that said, I believe in iBATIS 2 I used a NULL_OBJECT value to represent the difference between "yes I'm cached, and I'm null" vs. "I'm not cached". So I think there definitely is something to look at here.

Re: Scala object support in iBATIS 3

2009-12-31 Thread Clinton Begin
For both cases, I believe all necessary changes would be in the wrappers. However, there are places where Map is treated like a special case. But as long as you stick to making a peer to the bean wrapper, then you should be fine. While there's no factory class, the MetaObject framework uses a fac

Re: Scala object support in iBATIS 3

2009-12-31 Thread Chris Reeves
> Sounds interesting. > I assume you're referring to the need to call foo_= instead of setFoo. Yes, though I believe it ends up being foo_$eq. > Not sure I follow.  Is there any benefit in casting to ScalaObject? I > wonder whether it's possible to reference the ScalaObject interface by > name on

Re: New to iBatis facing problem to get started

2009-12-31 Thread Clinton Begin
You can sort of tell given his output: *PROFILE null* Exception in thread "main" java.lang.NullPointerException at Main.main(Main.java:23) So given that: 21.... 22.System.out.println(*"PROFILE " + profile*); 23.System.out.println(profile.getName()); 24.... We

Possible race condition using org.apache.ibatis.cache.Cache#hasKey ?

2009-12-31 Thread Simone Tripodi
Hi all guys, since I've been integrating 3rd part caching solutions[1] in iBatis3, I started thinking about the use of method in the Cache interface: org.apache.ibatis.cache.Cache#hasKey() Honestly, I'm a little scared about the use for a key check, as it may expire between checking for the key,

Re: Scala object support in iBATIS 3

2009-12-31 Thread Martin Ellis
2009/12/31 Chris Reeves : > I would like to add support for scala objects to iBATIS 3 for a > project I'm working on, and I have a few questions before I dive in > too deep. Sounds interesting. I assume you're referring to the need to call foo_= instead of setFoo. > This would allow the scala sup