You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Jean-François Smigielski <jf...@gmail.com> on 2007/12/09 14:40:29 UTC

Ghost/Dupplicated persistent objects

Hello, list!
I meet little harmless problems. Please, let me explain.

The context: I use Cayenne 3.0M1 in a Tomcat 6.0.14 server, in a set of
servlets that edit graphs : add/delete/update vertexes objects and
add/delete/update edges objects. Then, a last servlet builds graphs images
with the JUNG (http://jung.sourceforge.net) API.

The first problem appears when edges are deleted. Then, the deleted edge
still appears in the graph until I restart the Tomcat server. I guess it
comes from a cached object in a dataContext. But I am not totally sure it
does not come from a misuse of JUNG. All the servlets are inherited from the
same class, that provides a protected DataContext field initiated with "
DataContext.*createDataContext*(*true*);". *I am sure I felt on a newbie
gotcha, so is there any particular configuration parameter to check*?

The second problem happens less often, when graphs are rendered (I am not
able to reproduce it at the moment) : edges sometimes appear twice. Even if
it seems to be a misuse of JUNG, I tell it here because for each persistent
object's class (vertees and edges), I overwrote the methods "int hashCode()"
and the "boolean equals(Object o)" like this : "getObjectId().hashCode()"
and "getObjectId().equals(((CayenneDataObject)o).getObjectid())". *I would
be sure this should always work*.

These problems aren't maybe relevant to my use of Cayenne, but I think so.

Thank you for your help, or at least, to have read this mail until here :)

Best regards,

-- 
JF Smigielski