Re: Need Help: Cayenne Freezes

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jan 20 2005 - 19:47:19 EST

  • Next message: Pirola Davide: "RE: Problem with Oracle Driver"

    If this is indeed a thread lockup, you need to find out where it
    happens. I don't know what environment you are running in, so I am
    assuming this is a Java standalone app...

    The easiest thing to do is to use a debugger that I mentioned already.
    Second technique is to get a thread dump of all application threads. Do
    "Ctrl+Break" on Windows or "kill -QUIT java_process_id" on UNIX. This
    will output the state of all application threads (that can be quiet big
    sometimes)... You will see where each thread is stuck at the moment, so
    you can check for deadlocks (in particular you can check the stack of
    the thread that invoked getNotesArray()).

    Andrus

    On Jan 20, 2005, at 5:58 PM, Elia Morling wrote:

    >> I don't understand what you did here.
    > Sorry for being unclear.
    >
    > I have a class generated by cayenne: bbs
    >
    > If I do this the second print never occurs:
    > System.out.println("I'm going to try to get my notes.");
    > bbs.getNotesArray();
    > System.out.println("This is never reached.");
    >
    > I'm not overriding readProperty.
    >
    > Elia
    >
    > ----- Original Message ----- From: "Andrus Adamchik"
    > <andru..bjectstyle.org>
    > To: <cayenne-use..bjectstyle.org>
    > Sent: Thursday, January 20, 2005 11:01 PM
    > Subject: Re: Need Help: Cayenne Freezes
    >
    >
    >> What do you mean it freezes in this method? How do you know?
    >>> I tried putting it in a try/catch and it returns:
    >>> org.objectstyle.cayenne.Fault$ToManyFaul..c6572b
    >> I don't understand what you did here. It would be helpful if you post
    >> your
    >> Java code with the explanation of what happens at each line... But
    >> here is
    >> something you can check on your own:
    >> 1. A property is a Fault until "readProperty" is called, this is OK.
    >> Fault
    >> is converted to a List on demand when readProperty is called for the
    >> first
    >> time... So do you override "readProperty" somewhere by any chance and
    >> change its behavior?
    >> 2. You can debug your app in Eclipse. Set a breakpoint inside
    >> "getNotesArray", and start your application from Eclipse using "Debug"
    >> command instead of "Run". Once you hit the breakpoint, you can get
    >> down
    >> the call stack and see where it actually "freezes"... [I can't post a
    >> full
    >> manual on debugging in Eclipse here. If anyone could recommend a good
    >> online tutorial, please send a link]
    >> Andrus
    >>> I have a really wierd problem. Andrus asked me for a stack trace, but
    >>> there is none. The application simply freezes. This happens in an
    >>> auto
    >>> cayenne generated class while retrieving a to-many array. Like this:
    >>>
    >>> public List getNotesArray() {
    >>> return (List)readProperty("notesArray");
    >>> }
    >>>
    >>> I tried putting it in a try/catch and it returns:
    >>> org.objectstyle.cayenne.Fault$ToManyFaul..c6572b
    >>>
    >>> If I simply trace the object I also get:
    >>> {[ date => Sun Jun 27 23:44:39 CEST 2004
    >>> notesArray =>
    >>> org.objectstyle.cayenne.Fault$ToManyFaul..c6572b
    >>> ]<oid: com.bbs: <BBS_ID: 220>; state: committed>}
    >>>
    >>>
    >>> Any ideas?
    >>>
    >>> Elia
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Jan 20 2005 - 19:47:26 EST