Re: [JBoss-user] Many-to-many relation table is not being updated
I've managed to make it work! I simply moved the code (Collection.add) to a business method INSIDE the Entity Bean code. I was trying to do this by calling Collection.add from the Session Bean (facade) using Local references but this doesn't seem to work. Thanks for your help! Mauricio - Original Message - From: Marek Lange [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 03, 2003 7:34 AM Subject: Re: [JBoss-user] Many-to-many relation table is not being updated I tried this but it didn't work... :-( I have tried on JBoss 3.2.0RC2 too, but it didn't work too. I'm stucked on this for almost 2 weeks by now. :-( If you have any other suggestion or an example of 2 EJB with a many-to-many relationship between them coded using XDoclet, please send me. The fact, that you get the correct results if you populate the database manually, proofs that the relation is correctly working. So there seems to be another reason why the inserts do not work. Have you set up a 1:n relation before? Does this work? Perhaps there is a problem with your database? What are you using? -marek --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Many-to-many relation table is not being updated
I tried this but it didn't work... :-( I have tried on JBoss 3.2.0RC2 too, but it didn't work too. I'm stucked on this for almost 2 weeks by now. :-( If you have any other suggestion or an example of 2 EJB with a many-to-many relationship between them coded using XDoclet, please send me. The fact, that you get the correct results if you populate the database manually, proofs that the relation is correctly working. So there seems to be another reason why the inserts do not work. Have you set up a 1:n relation before? Does this work? Perhaps there is a problem with your database? What are you using? -marek --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Many-to-many relation table is not being updated
Yes, 1:N relations work perfectly. I'm usign default JBoss database (HSQLDB). I've tested with MySQL too. Same problem... :-( Mauricio - Original Message - From: Marek Lange [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 03, 2003 7:34 AM Subject: Re: [JBoss-user] Many-to-many relation table is not being updated I tried this but it didn't work... :-( I have tried on JBoss 3.2.0RC2 too, but it didn't work too. I'm stucked on this for almost 2 weeks by now. :-( If you have any other suggestion or an example of 2 EJB with a many-to-many relationship between them coded using XDoclet, please send me. The fact, that you get the correct results if you populate the database manually, proofs that the relation is correctly working. So there seems to be another reason why the inserts do not work. Have you set up a 1:n relation before? Does this work? Perhaps there is a problem with your database? What are you using? -marek --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] Many-to-many relation table is not being updated
Hello Marek I tried this but it didn't work... :-( I have tried on JBoss 3.2.0RC2 too, but it didn't work too. I'm stucked on this for almost 2 weeks by now. :-( If you have any other suggestion or an example of 2 EJB with a many-to-many relationship between them coded using XDoclet, please send me. Thanks! Mauricio - Original Message - From: Marek Lange [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March 01, 2003 9:10 PM Subject: Re: [JBoss-user] Many-to-many relation table is not being updated I have 2 entity EJBs (RoleBean and UserBean) with a many-to-many relationship between them and a session EJB (SecurityControlBean) for managing them. All EJBs are deployed correctly but I can't manage to make the relationship work correctly. When I manually populate the database (running INSERT SQL statements on the ROLE, USER and ROLE_USER tables) and run the method to query the Roles related to a User (SecurityControlBean.getAssignedRoles) everything works fine. However when I try to assing another Role to a User (using method SecurityControlBean.assignRole) the collection (UserBean.getRelatedRoles) is correctly updated but the relation table (ROLE_USER) is not. I have increased the JBoss log detail to DEBUG and I don't see any INSERT statement being executed when the SecurityControlBean.assignRole is executed. Perhaps you forget to set user.setRelatedRoles(roles); after ret = roles.add(role); Just an idea. -marek --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user --- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ___ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user