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
[JBoss-user] DynamicQL concurrency problem
Hello people!I've been using DynamicQL with CMP Entity Beans in JBoss 3.0.6 and it's working quite well, except for a little problem. When I've more than one client running a DynamicQL query at the same time over the same CMP Entity Bean, sometimes I got the following exception:2003-02-20 18:58:29,857 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException, causedBy:java.lang.NullPointerExceptionat org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:161)at org.jboss.ejb.plugins.cmp.jdbc.JDBCDynamicQLQuery.execute(JDBCDynamicQLQuery.java:101)at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCSelectorBridge.execute(JDBCSelectorBridge.java:64)at org.jboss.ejb.plugins.cmp.bridge.EntityBridgeInvocationHandler.invoke(EntityBridgeInvocationHandler.java:96)at org.jboss.proxy.compiler.Runtime.invoke(Runtime.java:59)at br.com.smbsoftware.webflow.tc.entity.TaskInfoBean$Proxy.ejbSelectGeneric(generated)at br.com.smbsoftware.webflow.tc.entity.TaskInfoBean.ejbHomeSelectGeneric(TaskInfoBean.java:731)at sun.reflect.GeneratedMethodAccessor436.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:324)at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1138)at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:207)at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:62)at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)at $Proxy198.selectGeneric(Unknown Source)at br.com.smbsoftware.webflow.tc.session.TaskControlBean.getTaskInfoId(TaskControlBean.java:932)at sun.reflect.GeneratedMethodAccessor483.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:324)at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:228)at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:92)at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:81)at $Proxy208.getTaskInfoId(Unknown Source)at br.com.smbsoftware.webflow.tc.TaskControlDelegate.getTaskInfoId(TaskControlDelegate.java:348)at br.com.smbsoftware.bombril.struts.SearchTaskAction.execute(SearchTaskAction.java:87)at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446)at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:280)at
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] Deadlocks
Hi! I didn't find any way do detect deadlocks on JBoss but you can change your jboss.xml to tell JBoss which methods do not need an EJB lock. In each entity entry in jboss.xml file, do the following change (in this example, get* methods are read-only): entity ejb-nameRole/ejb-name local-jndi-nameejb/webflow/local/Role/local-jndi-name !-- this tells JBoss that the get* methods are read-only -- method-attributes method method-nameget*/method-name read-onlytrue/read-only /method /method-attributes /entity I didn't find any XDoclet @tag to do this but I coded a XSLT transform: ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:output method=xml version=1.0 encoding=UTF-8 indent=yes/ xsl:template match=@*|node() xsl:copy xsl:apply-templates select=@*|node()/ /xsl:copy /xsl:template xsl:template match=entity xsl:copy xsl:apply-templates/ method-attributes method method-nameget*/method-name read-onlytrue/read-only /method /method-attributes /xsl:copy /xsl:template /xsl:stylesheet If you are using ant to build your project do something like this: xslt in=${original.jboss.xml} out=${modified.jboss.xml} style=${location.of.xslt.above} outputproperty name=method value=xml/ outputproperty name=standalone value=yes/ outputproperty name=encoding value=iso8859_1/ outputproperty name=indent value=yes/ xmlcatalog dtd publicId=-//JBoss//DTD JBOSS 3.0//EN location=${location.of.jboss.xml.dtd}/ /xmlcatalog /xslt The xmlcatalog tag above is optional. It's included here just to avoid a remote connection for the xml validation. I hope this helps. Greetings from Brazil! Mauricio - Original Message - From: Hunter Hillegas [EMAIL PROTECTED] To: JBoss User [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 5:00 PM Subject: [JBoss-user] Deadlocks I am seeing some deadlocks in a CMP 2.0 app that I recently put into production on JBoss 3.0.4. 90% of my access with the entities is read only. What can I do to troubleshoot/track down these deadlocks and fix them? Any help is appreciated. Thanks, Hunter --- 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
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