If you do "removeObject", it should give you back the original POJO. Later on, you can do another "putObject" again (as a merge, so to speak).
I did a quick test and it is still giving me the aspectized pojo. This is the proof.
The XML representation of my obj in different stage of execution:
before to store it in the cache: <com.cae.launchpad.core.dao.Student> <school>ULLAVAL</school> <courses class="linked-hash-set"> <com.cae.launchpad.core.dao.Course> <title>Spring</title> <instructor>Ben</instructor> <room>505</room> </com.cae.launchpad.core.dao.Course> </courses> <name>Pat</name> </com.cae.launchpad.core.dao.Student> Once in the cache: (notice the courses field is aspectized) <com.cae.launchpad.core.dao.Student> <school>ULLAVAL</school> <courses class="AOPClassProxy$0"/> <name>Pat</name> </com.cae.launchpad.core.dao.Student> ONce removed from the cache: (notice the courses field is still aspectized) <com.cae.launchpad.core.dao.Student> <school>ULLAVAL</school> <courses class="AOPClassProxy$0"/> <name>Pat</name> </com.cae.launchpad.core.dao.Student>
I think my observation (XML representation of the POJO) might be too complicated. I just wanted to express the fact that removing the object from the cache does not give me back the original POJO like expected according to Ben.
Is someone has some ideas???
I am a bit surprise that not that many people seems to have this requirement!
I am sort of counting on that !
Sorry, I didn't see your post untill now. Yes, I have tried to reproduce your step. Obviously it is a bug in 1.4 release.
Here is the Jira:
Current, 1.4.1 is in beta mode, so GA should come out in about 2 weeks timeframe. If you are in a hurry, you can also try to build the code after I do the fix (the next two days).
I would suggest that if you could add a method that will allow me to get back the original pojo (copy of) without removing the POJO from the cache, it would be create!!!!!
Is this a possible ???
Do you want PojoCache to introduce the Cloneable interface such that you can clone the POJO?
But if removeObject can do the job, is there still a need to so?
The ability to clone the POJO and get the not aspectized copy of it would be ideal. In fact, when I want a copy, I don't necessarily want to remove it from the cache and I definitely don't want the aspectized version of it (since I should not be concerned about aspectization).
PS: Event though cloning the POJO will full fill my requirement, I still think that removing the POJO from the cache should give back the not aspectized version of the POJO so that I think it is still a bug that need to be addressed.
Well, actually, if you want to get aound it, you can implement Cloneable in your POJO and clone it yourself.
PS: yes, it is a bug that I will fix soon.
The fix is in 1.4.1CR1. Will come out soon.
we are also having the serialization problem and unfortunately there is no rc for 1.4.1 by now. Is there a chance to get the fixed version soon ?