Re: Re[2]: Problems running Cayenne ORM Tier and CWS Client Tier on the same JVM.

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sat Jan 26 2008 - 06:58:40 EST

  • Next message: Jean-Paul Le Fèvre: "Re: Problem concerning Prefetching"

    On Jan 26, 2008, at 11:01 AM, <hmai..otmail.ru> <hmail@hotmail.ru>
    wrote:

    >
    > What i understood from chapter 'Running Client Without CWS' at the "http://cayenne.apache.org/doc/remote-object-persistence-coding-client.html
    > " page is that i can use data from the same library of my ObjEntity
    > classes (actually generated client classes) through not only remote
    > source channel (HessianConnection) but also through local source
    > channel (LocalConnection). I think the only reason i would need
    > standart Cayenne classes is if i need my application work faster.

    I see, we should probably remove the first example there (the one
    without a LocalConnection), as we are currently not testing such setup
    and can't guarantee that it works.

    > This mixing would be the most reasonable if i have a Web application
    > and desktop swing application working with same set of entities
    > (with one database). Then i wouldn't need to generate TWO packages
    > of classes representing one set of db entities. Also they together
    > might work faster, because they would use the same cache.
    > Well, this dream could come true only if both 'applications' use the
    > same Configuration. So i also thought that
    > Configuration.getSharedConfiguration() returns something other than
    > the conf CWS is using. Now that you say that CWS creates its own
    > configuration and stores it in the application-scoped object, i
    > ask: how then i can fetch this Configuration??

    You can subclass HessianService and expose its DataDomain protected
    variable to the application in a way that is appropriate for your
    app.. E.g. via a static method. Your custom subclass name can be
    passed to HessianServlet via "service-class" init parameter in
    "web.xml".

    > What is really strange, is why everything works with
    > HESSIAN_SERIALIZATION and does not with JAVA_ and NO_.

    Hmm... Yesterday I didn't realize that it worked for you with
    HESSIAN_SERIALIZATION *locally*... Now it is starting to make sense...
    I think this is due to the transient variables in some objects
    involved. During serialization they are being reset to NULL, while
    NO_SERIALIZATION leaves them in the "client state". I am still unsure
    about HESSIAN vs. JAVA though...

    Anyways, let me open a bug in Jira, and please use
    HESSIAN_SERIALIZATION for now.

    Thanks,
    Andrus
      



    This archive was generated by hypermail 2.0.0 : Sat Jan 26 2008 - 06:59:13 EST