Bugs item #1019591, was opened at 2004-08-31 06:30
Message generated for change (Comment added) made by juanmartinez
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1019591&group_id=22866

Category: JBossCMP
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Juan Martinez (juanmartinez)
Assigned to: Alexey Loubyansky (loubyansky)
Summary: Multiple CMRs in same tx

Initial Comment:
Hi.  
  
I've 3 entities which are in the following relationship:  
  
 A 1 -<->- * B * -->- 1 C  
  
and a method in session facade which creates a A entity and a lot  
of B entities. The C entities exists before the facade method is  
called.  
  
What happens is this:  
  
1) A is created  
2) Another method is called which creates B's with different  
properties (and sub-methods)  
3) The B is created with a reference to C (set is called in  
ejbPostCreate)  
4) The newly created B's are then assigned to A  
  
All tx attributes are set to "Required" in case of a failure  
somewhere under the creation.  
  
Inside the facade tx I can see that all B's has a reference to C.  
  
When the facade method completes a check to the database  
shows that only the last B's reference to C is set.  
  
That is:  
  
During facade tx (bean level):  
 B1 -> C1  
 B2 -> C1  
  
After facade tx (and in database):  
 B1 -> NULL  
 B2 -> C1  
  
A find call after the facade method shows this as well (b1.getC() 
== null && b2.getC() != null). CMP fields are fine in both cases. 
 
The A <-> B relationships are fine. 
 
All primary keys in A, B, and C are based on PostgreSQL 
sequences. The reference between the entities are based on 
sql-/jdbc-type INTEGER. 
 
The tests have been run on 3.2.6RC1 and 4.0.0RC1 -- not the 
branches, sorry. I searched the closed bug reports for 3.2.6RC2 
couldn't a match for this case. 
 
The container is run with default setup (COMMIT B). 
 
I can try and make a testcase if needed -- the original code 
creates 1000's of entities and have a lot more dependencies. 
 
Let me know if I can provide more information. 
 Juan 
 

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

>Comment By: Juan Martinez (juanmartinez)
Date: 2004-09-04 05:30

Message:
Logged In: YES 
user_id=870070

I managed to create a testcase based on only the B's and C's. 
 
You'll need jbossall-client.jar and XDoclet libs in the lib 
directory. 
 
Sorry for the  delay -- let me know if I can help with 
something. 
 Juan 

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

Comment By: Juan Martinez (juanmartinez)
Date: 2004-09-01 06:39

Message:
Logged In: YES 
user_id=870070

insert-after-ejb-post-create hasn't been changed, so it's false. 
 
I'll try and make a testcase for you. 

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

Comment By: Alexey Loubyansky (loubyansky)
Date: 2004-08-31 07:23

Message:
Logged In: YES 
user_id=543482

Is insert-after-ejb-post-create true? In other words, is the
valid primary key available after ejbCreate but before
ejbPostCreate?
A testcase would help.

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

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


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to