Bugs item #665067, was opened at 2003-01-09 16:12
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=665067&group_id=22866
Category: JBossCX
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Ukpong (michaelukpong)
Assigned to: David Jencks (d_jencks)
Summary: Managed Connection equals Null! Problems in JBOSS 3.0.3
Initial Comment:
The .remove() method of some Entity beans I wrote and
deployed in JBoss 3.0.0 is now throwing a "Managed
Connection = null" exception in Jboss 3.0.3.
I earlier noticed that these entities gave a "you are not
getting the semantics you expect" warning (both in
Jboss 3.0.0 and 3.0.3) but I ignored this warning in
Jboss 3.0.0. Could this be the cause of the exception
now thrown in Jboss 3.0.3?
The funny thing is that if you keep looping on the remove
(), where the number of iterations is the record length of
the underlying table + 1, it eventually works! So its like
the managed connection is restored after a certain
number of failed attempts. What could this mean?
Note that this remove() method is NOT called directly
from a servlet, but through a stateless session bean.
----------------------------------------------------------------------
>Comment By: Michael Ukpong (michaelukpong)
Date: 2003-01-13 15:30
Message:
Logged In: YES
user_id=684393
Thank you very much for responding
I have not yet downloaded 3.0.5. I did not see it listed
The bean is uses BMP and does NOT have any .equals()
overiding method
#!!!!!!!Here is the Session bean level Method that calls the
remove it is Stateless
public void deletePortal(Integer portalID) throws
PortalException {
PortalSettingsHome portalSettingsHome;
PortalRolesHome portalRolesHome;
PortalUsersHome portalUsersHome;
PortalsHome portalsHome;
java.util.Iterator i;
try{
portalSettingsHome = (PortalSettingsHome)
EjbUtilities.getHome("portal/PortalSettings",
PortalSettingsHome.class);
portalRolesHome = (PortalRolesHome)
EjbUtilities.getHome("portal/PortalRoles",
PortalRolesHome.class);
portalUsersHome = (PortalUsersHome)
EjbUtilities.getHome("portal/PortalUsers",
PortalUsersHome.class);
portalsHome = (PortalsHome) EjbUtilities.getHome
("portal/Portals", PortalsHome.class);
// remove some dependencies
i = portalSettingsHome.findByPortal
(portalID).iterator();
while(i.hasNext()){
((com.sw.portal.entity.portalSetting.PortalSettings)
i.next()).remove();
}
i = portalRolesHome.findByPortal(portalID).iterator();
while(i.hasNext()){
((PortalRoles)i.next()).remove();
}
i = portalUsersHome.findByPortal
(portalID).iterator();
while(i.hasNext()){
((PortalUsers)i.next()).remove();
}
//finally, remove the Portal
portalsHome.findByPrimaryKey(portalID).remove(); //
Here is where the exception is thrown
} catch (Exception e) {
throw new PortalException(e.getMessage());
}
}
#!!!!!!! Here is the Entity bean level remove method it is a BMP
public void ejbRemove() {
try
{
String sqlStmt = "DELETE FROM Portals WHERE
PortalID = ? ";
con = ds.getConnection();
PreparedStatement stmt = con.prepareStatement
(sqlStmt);
stmt.setInt(1, portalID);
stmt.executeUpdate();
stmt.close();
}catch (Exception e)
{
throw new EJBException(e);
}finally
{
try
{
if (con != null)
{
con.close();
}
} catch (SQLException sqle) {}
}
}
Here is a code fragment of the exception
java.lang.IllegalArgumentException: disconnect
(ManagedConnection mc: null, Object c:
org.jboss.resource.adapter.jdbc.local.LocalConnection@70ad
76) called with unknown managed connection at
org.jboss.resource.connectionmanager.BaseConnectionMana
ger2.unregisterAssociation
(BaseConnectionManager2.java:661) at
org.jboss.resource.connectionmanager.BaseConnectionMana
ger2.disconnect(BaseConnectionManager2.java:619) at
org.jboss.resource.connectionmanager.CachedConnectionMa
nager.disconnect(CachedConnectionManager.java:371) at
org.jboss.resource.connectionmanager.CachedConnectionMa
nager.popMetaAwareObject
(CachedConnectionManager.java:160) at
org.jboss.resource.connectionmanager.CachedConnectionInte
rceptor.invoke(CachedConnectionInterceptor.java:190) at
org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke
(EntityReentranceInterceptor.java:64) at
org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke
(EntityInstanceInterceptor.java:152) at
org.jboss.ejb.plugins.EntityLockInterceptor.invoke
(EntityLockInterceptor.java:107) at
org.jboss.ejb.plugins.EntityCreationInterceptor.invoke
(EntityCreationInterceptor.java:69) at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:107) at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions
(TxInterceptorCMT.java:178) at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:60) at
org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:130) at
org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203) at
org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
at org.jboss.ejb.Container.invoke(Container.java:712) at
org.jboss.ejb.EntityContainer.invoke
(EntityContainer.java:1058) at
org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517) at
org.jboss.invocation.local.LocalInvoker.invoke
(LocalInvoker.java:98) at
org.jboss.invocation.InvokerInterceptor.invoke
(InvokerInterceptor.java:102) at
org.jboss.proxy.TransactionInterceptor.invoke
(TransactionInterceptor.java:77) at
org.jboss.proxy.SecurityInterceptor.invoke
(SecurityInterceptor.java:80) at
org.jboss.proxy.ejb.EntityInterceptor.invoke
(EntityInterceptor.java:116) at
org.jboss.proxy.ClientContainer.invoke
(ClientContainer.java:76) at $Proxy282.remove(Unknown
Source) at
com.sw.portal.session.PortalManagerBean.deletePortal
(Unknown Source) at java.lang.reflect.Method.invoke(Native
Method) at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor
.invoke(StatelessSessionContainer.java:660) at
org.jboss.resource.connectionmanager.CachedConnectionInte
rceptor.invoke(CachedConnectionInterceptor.java:186) at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.inv
oke(StatelessSessionInstanceInterceptor.java:77) at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:107) at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions
(TxInterceptorCMT.java:178) at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:60) at
org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:130) at
org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:203) at
org.jboss.ejb.StatelessSessionContainer.invoke
(StatelessSessionContainer.java:313) at
org.jboss.ejb.Container.invoke(Container.java:712) at
org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:517) at
org.jboss.invocation.local.LocalInvoker.invoke
(LocalInvoker.java:98) at
org.jboss.invocation.InvokerInterceptor.invoke
(InvokerInterceptor.java:102) at
org.jboss.proxy.TransactionInterceptor.invoke
(TransactionInterceptor.java:77) at
org.jboss.proxy.SecurityInterceptor.invoke
(SecurityInterceptor.java:80) at
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke
(StatelessSessionInterceptor.java:111) at
org.jboss.proxy.ClientContainer.invoke
(ClientContainer.java:76) at $Proxy275.deletePortal(Unknown
Source) at
com.sw.admin.module.admin.AdminModuleBean.deletePortal
s(Unknown Source) at
com.sw.admin.module.admin.AdminModuleBean.execute
(Unknown Source)
----------------------------------------------------------------------
Comment By: David Jencks (d_jencks)
Date: 2003-01-11 14:41
Message:
Logged In: YES
user_id=60525
Please try 3.0.5 and see if the problem is already fixed.
How about some details or a test case?
BMP or CMP?
If BMP, are you holding the connection between method invocations or
getting it each time you need it?
Have you defined .equals in your entity?
Have you marked the datasource as an unsharable resource?
Thanks
david jencks
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=665067&group_id=22866
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development