Bugs item #832429, was opened at 2003-10-29 17:00
Message generated for change (Comment added) made by loubyansky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=832429&group_id=22866

Category: JBossCMP
Group: v3.2
>Status: Closed
Resolution: Fixed
Priority: 9
Submitted By: Sascha Kulawik (skulawik)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: CMR Field can't be setted to NULL

Initial Comment:
Hello,

I'm expirienced a very stange problem in JBoss 3.2.2 FINAL.
Just for information: I've also tried with JBoss 3.2.1
and with JBoss 3.2.2RC4 and there seems everything
working correctly.

I've a CMP Bean concatenated with a double link list -
every Bean knows his previous one and his next one.
If there is no next or previous node it will be null.
This relationships are managed though CMR. 

If I move one Bean "up" in the double link list,
following code will be executed:

ViewComponentLocal prev = view.getPrevNode();
ViewComponentLocal next = view.getNextNode();
ViewComponentLocal prevPrev = prev.getPrevNode();
ViewComponentLocal parent = view.getParent();

prevPrev.setNextNode(view);
view.setPrevNode(prevPrev);
view.setNextNode(prev);
prev.setPrevNode(view);
prev.setNextNode(next);


The amaizing part of this code is following:
If view.getNexNode() is null (view is the last element
in this double link list), the last command is
logically prev.setNextNode(null). But this "null" will
be never saved - if it is a physical Node everythink
went ok.
As well as execute this Code with JBoss 3.2.1.
There is also one next possibility to solve this issue:
switching the last command (prev.setNextNode(next))
prior to "prevPrev.setNextNode(view)" for example - but
IMHO there must be an error in JBoss - so I'm a little
bit confused if this can occur on many places in my
code (currently about 50.000 Lines of Code ony on
Serverside).

I'm really sorry about this testcase - would be much
nicer to give you something you can really test - but
as I've seen in the Changelogs from RC4->Final that
there was a lot of changes in the files regarding CMR
and so it might be that thus person knows where the
error resists.

Regards,

Sascha




----------------------------------------------------------------------

>Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-11-17 21:04

Message:
Logged In: YES 
user_id=543482

It is regression. This time I added a testcase for this bug.
Fixed in JBoss_3_2 and HEAD.

----------------------------------------------------------------------

Comment By: Sascha Kulawik (skulawik)
Date: 2003-11-15 19:34

Message:
Logged In: YES 
user_id=362237

Ive just downloaded the JBoss 3.2.3RC1 Release, but the Bug
still remains. Is it not in this branch fixed?

----------------------------------------------------------------------

Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-10-31 14:33

Message:
Logged In: YES 
user_id=543482

Fixed in Branch_3_2.

* CMR field had stale getDirty()/setClean() logic.
* in current implementation, CMR field value should not be
considered as clean after its value is loaded from the
database or preloaded cache because we support
adding/removing relations while the field is not loaded yet.
* foreign key fields should not be setClean() in CMR field.
They are part of entity's table fields and treated as
entity's CMP fields.

----------------------------------------------------------------------

Comment By: Sascha Kulawik (skulawik)
Date: 2003-10-29 22:48

Message:
Logged In: YES 
user_id=362237

Thank you very much.
No you are right - it is not really necessary - might be a
good idea :)


----------------------------------------------------------------------

Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-10-29 20:14

Message:
Logged In: YES 
user_id=543482

Accepted. I can reproduce it. Thank you.

Is there really a need for two unidirectional relationships
that form next - prev relationship? You could do it with one
bidirectional and avoid redundant column in the table.

----------------------------------------------------------------------

Comment By: Sascha Kulawik (skulawik)
Date: 2003-10-29 19:12

Message:
Logged In: YES 
user_id=362237

I've attached a SQL File and a CMP Entity Bean with XDoclet
Tags for creation of the Interfaces and so on.
Please tell me if there is something missing.

----------------------------------------------------------------------

Comment By: Alexey Loubyansky (loubyansky)
Date: 2003-10-29 18:36

Message:
Logged In: YES 
user_id=543482

I tried to follow the steps you described and haven't seen
the problem. I tried with foreign key column pointing to the
next and previous nodes. The logic moving a node is exactly
the same as yourth.
Though, in my case, if you prevPrev.setNextNode(view)
you don't have to view.setPrevNode(prevPrev). Or if you
view.setNextNode(prev) you don't have to prev.setPrevNode(view).

Could you, please, post your deployment descriptors, the
table's DDL statement, anything else you think might help me
to reproduce the problem? If you have a testcase, it would
be ideal. Thanks.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=832429&group_id=22866


-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to