Re: LazyLoading and CGLIB return wrong types
I am just adding functionality to an application which has been running for some time , I can't just disable lazy loading without knowing what (disastrous) side effects it could cause Jeff Butler-2 wrote: Are you really sure that lazy loading is buying you anything? I think people turn this on because it's theoretically cool, but I really doubt its efficacy in so many cases. It seems like turning it off would solve all your issues - and maybe wouldn't have any noticeable impact on your application performance. It's worth a try. Jeff Butler On Wed, Jul 29, 2009 at 2:09 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24713673.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24733352.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Probably it would but the reason I am using xStream is because it does the (conversion) job quickly and easily , I don't really want to spend much time on writing code for conversion , not to mention that are tens of classes to be marshaled. Stelio cmathrusse wrote: Why not then create a custom converter for your class? http://xstream.codehaus.org/converter-tutorial.html You can create a custom converter for XStream that will convert your object into XML using only the fields that you want marshalled, effectively eliminating all fields that are generated by CGLIB. Wouldn't that solve your issue? Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Dawson Lewis hardcore...@yahoo.com.br To: user-java@ibatis.apache.org Date: 07/29/2009 12:09 AM Subject: Re: LazyLoading and CGLIB return wrong types Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24713673.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24733436.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Aside from the fact that you don't want to write any additional code, this option is viable. It seems that you could easily create a Java class that could generate all of you XStream converters for you using reflection to discover the fields of your objects. This would only take a short time to write and could generate all the converters for you tens of classes. I'm certain that there are other options available to generate the converters for you as well, but if you are well versed in Java then it should be a small effort. You've already stated that you don't want to disable lazy loading as it may have an impact on the system, and this would be an almost zero impact on your existing system. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Stelio Macumbe hardcore...@yahoo.com.br To: user-java@ibatis.apache.org Date: 07/30/2009 12:25 AM Subject: Re: LazyLoading and CGLIB return wrong types Probably it would but the reason I am using xStream is because it does the (conversion) job quickly and easily , I don't really want to spend much time on writing code for conversion , not to mention that are tens of classes to be marshaled. Stelio cmathrusse wrote: Why not then create a custom converter for your class? http://xstream.codehaus.org/converter-tutorial.html You can create a custom converter for XStream that will convert your object into XML using only the fields that you want marshalled, effectively eliminating all fields that are generated by CGLIB. Wouldn't that solve your issue? Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Dawson Lewis hardcore...@yahoo.com.br To: user-java@ibatis.apache.org Date: 07/29/2009 12:09 AM Subject: Re: LazyLoading and CGLIB return wrong types Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com
Re: LazyLoading and CGLIB return wrong types
Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24713673.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
RE: LazyLoading and CGLIB return wrong types
Yea, your best bet is to disable lazy loading. -Original Message- From: Dawson Lewis [mailto:hardcore...@yahoo.com.br] Sent: Wed 7/29/2009 1:09 AM To: user-java@ibatis.apache.org Subject: Re: LazyLoading and CGLIB return wrong types Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24713673.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Are you really sure that lazy loading is buying you anything? I think people turn this on because it's theoretically cool, but I really doubt its efficacy in so many cases. It seems like turning it off would solve all your issues - and maybe wouldn't have any noticeable impact on your application performance. It's worth a try. Jeff Butler On Wed, Jul 29, 2009 at 2:09 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24713673.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Why not then create a custom converter for your class? http://xstream.codehaus.org/converter-tutorial.html You can create a custom converter for XStream that will convert your object into XML using only the fields that you want marshalled, effectively eliminating all fields that are generated by CGLIB. Wouldn't that solve your issue? Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Dawson Lewis hardcore...@yahoo.com.br To: user-java@ibatis.apache.org Date: 07/29/2009 12:09 AM Subject: Re: LazyLoading and CGLIB return wrong types Hi, I am aware of that , but there are so many fields to exclude. It should not be that way . Plus it is really annoying to track all those classes iBatis is creating. Look at the following XML snippet xStream is producing addresses class=dynamic-proxy I may able of omitting fields but how do I get rid of the class attribute ? I tried type casting before serializing but it also does not work. Stelio cmathrusse wrote: XStream already has the capability to exclude specific fields from the serialization. It's rather easy: com.thoughtworks.xstream.XStream xstream; ... xstream.omitField(YouriBatisClass.class, fieldName); That's it! You can omit as many fields as you want. You can even omit them with Annotations but I don't think that would help much with CGLIB generated classes. Chris Mathrusse christopher.mathru...@sybase.com Sybase, Inc From: Clinton Begin clinton.be...@gmail.com To: user-java@ibatis.apache.org Date: 07/28/2009 06:10 AM Subject: Re: LazyLoading and CGLIB return wrong types You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.br wrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24713673.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
You'll have to paste it in, as attachements get stripped. I think I've seen it before though, a bunch of $adfweragvav type fields. I wish there was a way in XStream to ignore fields that start with $ or something. You'd have the same problem with any framework that uses CGLIB or ASM etc. I've heard that Betwixt might be a good alternative to XStream in this regard. Or you could try modifying XStream to ignore $ fields and subit a patch back to them. Cheers, Clinton On Tue, Jul 28, 2009 at 2:35 AM, Dawson Lewis hardcore...@yahoo.com.brwrote: Hi, It is what I am doing , I am using xStream 1.3 for serializing , I was using the 1.3.1 version before but it could not serialize synchronized collections , then I switch to 1.3. It seems that xStream is also serializing those objects created by iBatis at runtime . Have a look at the xml file generated by xStream , see how much garbage (meaning no disrespect for either iBatis or xStream because I love them both) is being added. I do not want to serialize these iBatis enhanced objects . Regards, Stelio Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24694842.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Hi, Do you have any clue in how to do that ? I created a clone method for the Address class so every object is cloned before it is serialized. It works fine but do you think this is a good idea ? Best Regards Stelio Larry Meadors wrote: You should be able to, yeah. Larry On Thu, Jul 23, 2009 at 12:39 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Thanks for you reply Larry, Is there a way I can get the normal Address objects ? I need to serialize those objects to XML , the extra fields in these enhanced classes will create problems when deserializing because maybe the application that will deserialize is not using iBatis. Can't I just disable lazy loading and CGLIB for performing serialization ? Regards Larry Meadors wrote: They are still Address objects, just enhanced ones. Larry On Wed, Jul 22, 2009 at 7:58 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi , I have an object with a List property - ListAddress addresses, after iBatis populates this object the addresses fields will not contain a list of address objects but a List$$EnhancerCGLIBb$$475a4210 , according to the eclipse debugger. This only happens when lazyLoadingEnabled and enhancementEnabled are set to true. Is there anyway I can get a list of addresses (ListAddress) without disabling lazy loading or enhancement ? Best regards -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24607048.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24620151.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24675025.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Have you tried serializing to XStream or another alternative, instead of using Java's serialization? While this is a limitation of iBATI 2 (version 3 solves it somewhat, but still not between systems), you should never depend on Java serialization for connecting two systems. You should choose a more canonical serialization process. XStream is my personal favourite, but there are many others (even some binary). Java serialization is a bad thing to depend upon. Cheers, Clinton On Mon, Jul 27, 2009 at 1:44 AM, Dawson Lewis hardcore...@yahoo.com.brwrote: Hi, Do you have any clue in how to do that ? I created a clone method for the Address class so every object is cloned before it is serialized. It works fine but do you think this is a good idea ? Best Regards Stelio Larry Meadors wrote: You should be able to, yeah. Larry On Thu, Jul 23, 2009 at 12:39 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Thanks for you reply Larry, Is there a way I can get the normal Address objects ? I need to serialize those objects to XML , the extra fields in these enhanced classes will create problems when deserializing because maybe the application that will deserialize is not using iBatis. Can't I just disable lazy loading and CGLIB for performing serialization ? Regards Larry Meadors wrote: They are still Address objects, just enhanced ones. Larry On Wed, Jul 22, 2009 at 7:58 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi , I have an object with a List property - ListAddress addresses, after iBatis populates this object the addresses fields will not contain a list of address objects but a List$$EnhancerCGLIBb$$475a4210 , according to the eclipse debugger. This only happens when lazyLoadingEnabled and enhancementEnabled are set to true. Is there anyway I can get a list of addresses (ListAddress) without disabling lazy loading or enhancement ? Best regards -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24607048.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24620151.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24675025.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
Thanks for you reply Larry, Is there a way I can get the normal Address objects ? I need to serialize those objects to XML , the extra fields in these enhanced classes will create problems when deserializing because maybe the application that will deserialize is not using iBatis. Can't I just disable lazy loading and CGLIB for performing serialization ? Regards Larry Meadors wrote: They are still Address objects, just enhanced ones. Larry On Wed, Jul 22, 2009 at 7:58 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi , I have an object with a List property - ListAddress addresses, after iBatis populates this object the addresses fields will not contain a list of address objects but a List$$EnhancerCGLIBb$$475a4210 , according to the eclipse debugger. This only happens when lazyLoadingEnabled and enhancementEnabled are set to true. Is there anyway I can get a list of addresses (ListAddress) without disabling lazy loading or enhancement ? Best regards -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24607048.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24620151.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
You should be able to, yeah. Larry On Thu, Jul 23, 2009 at 12:39 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Thanks for you reply Larry, Is there a way I can get the normal Address objects ? I need to serialize those objects to XML , the extra fields in these enhanced classes will create problems when deserializing because maybe the application that will deserialize is not using iBatis. Can't I just disable lazy loading and CGLIB for performing serialization ? Regards Larry Meadors wrote: They are still Address objects, just enhanced ones. Larry On Wed, Jul 22, 2009 at 7:58 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi , I have an object with a List property - ListAddress addresses, after iBatis populates this object the addresses fields will not contain a list of address objects but a List$$EnhancerCGLIBb$$475a4210 , according to the eclipse debugger. This only happens when lazyLoadingEnabled and enhancementEnabled are set to true. Is there anyway I can get a list of addresses (ListAddress) without disabling lazy loading or enhancement ? Best regards -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24607048.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24620151.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org
Re: LazyLoading and CGLIB return wrong types
They are still Address objects, just enhanced ones. Larry On Wed, Jul 22, 2009 at 7:58 AM, Dawson Lewishardcore...@yahoo.com.br wrote: Hi , I have an object with a List property - ListAddress addresses, after iBatis populates this object the addresses fields will not contain a list of address objects but a List$$EnhancerCGLIBb$$475a4210 , according to the eclipse debugger. This only happens when lazyLoadingEnabled and enhancementEnabled are set to true. Is there anyway I can get a list of addresses (ListAddress) without disabling lazy loading or enhancement ? Best regards -- View this message in context: http://www.nabble.com/LazyLoading-and-CGLIB-return-wrong-types-tp24607048p24607048.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org - To unsubscribe, e-mail: user-java-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-java-h...@ibatis.apache.org