Re: Spring light integration

From: Malcolm Edgar (malcolm.edga..mail.com)
Date: Sun Nov 11 2007 - 17:09:34 EST

  • Next message: james: "Re: [POLL]: Cayenne 3.0 -- Java 1.4 or 5 support?"

    Hi Landry,

    You will need to setup a DataContext servlet filter in your web application
    to bind a DataContext to the request thread.

    regards Malcolm Edgar

    On Nov 12, 2007 6:07 AM, Landry Soules <cayennem..mail.com> wrote:

    > Hello,
    >
    > I'm currently working on a web project developped with Wicket and
    > Cayenne. Everything worked fine but we are now planing to use Spring too.
    > I've seen the examples on the wiki, but i found it quite complex , since
    > i don't want to go the DAO way.
    > Indeed, the only Spring/Cayenne interaction i need is for retrieving
    > DataContext.
    > I wrote this in applicationContext.xml:
    >
    > <bean id="dataContext" class="org.apache.cayenne.access.DataContext"
    > factory-method="getThreadDataContext" />
    > <bean id="customPanel" class="eu.kwark.base.CustomPanel">
    > <property name="context" ref="dataContext" />
    > </bean>
    >
    > But when i start my webapp, i get a "java.lang.IllegalStateException:
    > Current thread has no bound DataContext"
    >
    > Is there a way to go while keeping it simple and avoiding DAOs ?
    >
    > Thanks for your help.
    >
    >
    > Landry
    >



    This archive was generated by hypermail 2.0.0 : Sun Nov 11 2007 - 17:10:06 EST