users@glassfish.java.net

Toplink looses information???

From: <glassfish_at_javadesktop.org>
Date: Mon, 10 Sep 2007 14:20:00 PDT

I have a very weird an frustrating problem. Well, a set of problems actually. They suddenly appeared, I just diffed my stuff and did not find any "interesting" changes I made.

Examples of the problems are:

1.) I have 2 entities "User" and "Group". They are mapped to each other as ManyToMany. In the DB it looks like this:
User:
uid 1 / admin

Groups:
gid 1 / general group
gid 2 / admin group

users_groups:
uid 1 gid 1
uid 1 gid 2

I have a check that checks whether a user is in group 2 or not to see whether he is an administrator.

[b]So this is what happens[/b]: I load the user-object from the database. I create an Iterator on the "groups"-Set it has. It prints out only one group. I redeploy the application, do it again, it prints out both. Redeploy again, now only one again. And so on, totally random.

2nd problem:
I have an entity called "Expression", owned by a user. I create one, persist it. Works fine. Redeploy ... and suprise surprise, on updating it, Toplink tries to null the "owner" field. Redeploy again, same do the same stuff, now it works. After the next redeploy, it had already ceased working again.

Of course I not only did redeploys, I also did countless full restarts.

Now I wonder what could be the reason for this behaviour? Any ideas?

I don't know what to do and I am happy about any information.
[Message sent by forum member 'david1' (david1)]

http://forums.java.net/jive/thread.jspa?messageID=234755