I have an approach that uses factories that does not require CGLib if
your interested.

On 9/13/07, Adam Taft <[EMAIL PROTECTED]> wrote:
> Tom McGee wrote:
>  > Should this in the appicationContext.xml:
>  > <bean id="fooResource" scope="request" class="FooResource" />
>  > be this:
>  > <bean id="fooResource" scope="request" class="FooResource"
>  > scope="prototype"/>
>
> It should be either one of two ways:
>
> a) <bean id="fooResource" scope="request" class="FooResource" />
>
> b) <bean id="fooResource" scope="prototype" class="FooResource" />
>
> -a- should "theoretically" work in a servlet environment (like he's
> using).  I say theoretically, because this is getting into some edge
> case uses of spring.
>
> -b- would be the only reasonable choice outside of the servlet
> environment or if things didn't work with -a-.
>
> Of course, as I've mentioned before, using lookup-method implies using
> CGLib proxies in Spring.  The problem would ideally not have to be
> solved in this way.  I have found, for example, that using a
> lookup-method declaration (which creates a CGLib proxy) will clash with
> other proxies such as Spring's database transaction management features.
>   Your transactions will never roll back automagically even on failure.
>
> Anyway, the point is, one should tread carefully when using
> lookup-method, as it's definitely a work around and not a main stream
> way to use Spring.
>
>  > On 9/13/07, Makunas, Michael <[EMAIL PROTECTED]> wrote:
>  > haven't tested it in anything close to production.
>
> Break out Apache bench and start testing.  Make sure you're testing and
> confirming your complete stack is working right, including database
> transactions that both succeed and fail.  Again, as mentioned,
> generating proxies on top of proxies will likely lead to edge case
> goofiness and hard to track down bugs, so pay particular attention to this.
>
> Adam
>

Reply via email to