« Return to Thread: LazyInitializationException in XXManagerTestCase

Re: LazyInitializationException in XXManagerTestCase

by ayan :: Rate this Message:

Reply to Author | View in Thread

Great input Sir.

I haven't got deeper on the appfuse and spring, If I had time to look on those Spring Test classes, I'll try. ;-)

My archi just decided to load the collection from the DAO and use it on Service layer test case, as you have suggest, we leave it out temporarily those mappings we have already created on our entities which lazy loads its collection.

cheers, ayan

mraible wrote:
If I said the reason BaseManagerTestCase extends
AbstractDependencyInjectionSpringContextTests instead of
AbstractTransactionalDataSourceSpringContextTests was to show possible
lazy-loading issues, would you believe me? ;-)

If you're going to expose any of your service-layer objects through
web services, you should probably initialize all the lazy collections
in your DAO or Service layer.  In the most recent version of AppFuse,
we've removed the OpenSessionInViewFilter from web.xml.  We did it to
make it easier to use the same web.xml for any type of persistence
framework. With that being said, I don't see a problem with using
lazy-loading, so if you'd like us to change BaseManagerTestCase,
please enter an issue in JIRA.

We could also change it to extend
AbstractAnnotationAwareTransactionalTests, which allows you to use
annotations to indicate transactional methods.

http://tinyurl.com/298vaw

Matt
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/LazyInitializationException-in-XXManagerTestCase-tf3684711s2369.html#a10299277
> Sent from the AppFuse - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
> For additional commands, e-mail: users-help@appfuse.dev.java.net
>
>


--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@appfuse.dev.java.net
For additional commands, e-mail: users-help@appfuse.dev.java.net

 « Return to Thread: LazyInitializationException in XXManagerTestCase