Bugs item #523627, was opened at 2002-02-27 17:04 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=523627&group_id=22866
Category: JBossCMP Group: v3.0 Rabbit Hole Status: Open Resolution: None >Priority: 7 Submitted By: Michael Newcomb (mnewcomb) Assigned to: Nobody/Anonymous (nobody) Summary: CMR is broken? Initial Comment: Check out the attached test case. If you try to re-use newly created (within same session bean method) Local ejb's as parameters to create other local ejb's, the CMR relationship is messed up. If you do a findByPrimaryKey() and use that returned Local ejb object, the CMR relationship is ok. Have to go, or I'd try to debug a little more. I did get a test case together to show the problem. test case procedure: export JBOSS_DIST="<jboss_install>/jboss-3.0.0beta2" ant ant deploy ant client-fail ant undeploy ant deploy ant client-pass Thanks, Michael ---------------------------------------------------------------------- >Comment By: Michael Newcomb (mnewcomb) Date: 2002-02-28 09:43 Message: Logged In: YES user_id=382427 Sorry about the brevity of the initial post, but I wanted to get the bug out there, but it doesn't seem that anyone has had a chance to look at the test case. Here is a more in depth explanation: I have an EJB, with a many-to-one relationship to itself. This relationship is a parent-child relationship. You can create this EJB with or without a parent. Now, I have a session bean that is passed some data and is responsible for creating these beans with the appropriate relationships between parents and children. The data is provided in a way that the every parent is processed before any of its children. This allows the parent to be passed into the home.create() method for its children. So, the session bean starts processing the data. As he creates the beans, he locally stores the LocalEJB objects in a map (just in a method-local cache, not a member attribute of the bean). Then, when processing a child, he looks up its parents LocalEJB object in the map and proceeds to pass that into the home.create() method for the child. Now, when I do this, the CMR field on the child doesn't always get set! I verify it is not getting set because there is no update sql call after the insert call. However, if I use home.findByPrimaryKey() instead of caching the LocalEJB objects in a map, the CMR field is always set and I see an update for every insert. Am I not allowed to cache those LocalEJB objects in my session bean method? (I'm just caching them in the method, not the session bean itself...) It almost seems like the persistence manager does not think that the EJB needs to be updated when the CMR field gets set in the ejbPostCreate? But, only when using LocalEJB objects that were created using home.create()? Because LocalEJBs returned by home.findByPrimaryKey() work fine? Please review the attached test case and help me understand why I'm seeing this behavior. Oh, and I've tested this against mySQL and hypersonic that comes with JBoss. The test case is written to use the default datasource. Thanks, Michael ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=376685&aid=523627&group_id=22866 _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development
