Bugs item #630665, was opened at 2002-10-29 21:32 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=630665&group_id=22866
Category: JBossCMP Group: v3.0 Rabbit Hole Status: Open Resolution: None Priority: 5 Submitted By: Leon Doud (ldoud) Assigned to: Nobody/Anonymous (nobody) Summary: CMR within one transaction Initial Comment: When two objects are created in the same transaction setting a relation between these objects fails. There is no exception given, but the foreign key is NULL. The test case submitted uses one session bean with two almost identical methods. The only difference is that one method has the transaction type of "Required" and the other has a type of "NotSupported". The test case for the required transaction fails, while the other test case passes. This test only covers one-to-many bidirectional relationships. It was tested against the latest CVS code for Branch_3_0, using Windows 2000 and JDK 1.4.0. ---------------------------------------------------------------------- >Comment By: Alexey Loubyansky (loubyansky) Date: 2002-11-09 15:48 Message: Logged In: YES user_id=543482 Dain, sorry for confusion. The key is of type CustomerPK that just wraps the int id. So, it's ok according to the spec but zero values will be represented as null anyway. Also, for me, the test attached doesn't work with zero values for Required or NotSupported either. But works for both with non-zero values for id, though, I tested against HEAD on Win2K, jdk1.3.1. alex alex ---------------------------------------------------------------------- Comment By: Dain Sundstrom (dsundstrom) Date: 2002-11-09 00:20 Message: Logged In: YES user_id=251431 A primitive int is not allowed for a primary key. The spec requires an Object, as the primary key is returned from a method that returns an Object. The verifier should have thrown an error. Did you turn off the verifier? If not, this is a verifier bug. ---------------------------------------------------------------------- Comment By: Alexey Loubyansky (loubyansky) Date: 2002-11-08 23:50 Message: Logged In: YES user_id=543482 I don't understand why it works for NotSupported. The problem is that, you are using 'int' for primary key with zero value. Currently, foreign keys can't be 'NOT NULL'. On the other hand, 'int' can't be null, so null equivalent is 0. Thus, relationships are not set. Try the following: 1. use int for pk but non-zero values; 2. use java.lang.Integer instead of int. alex ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=630665&group_id=22866 ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development