Bugs item #885095, was opened at 2004-01-27 01:09
Message generated for change (Comment added) made by techtime
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=885095&group_id=22866

Category: JBossCX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Dag Liodden (daggerrz)
Assigned to: Nobody/Anonymous (nobody)
Summary: Synchronization errors in pooling implementation?

Initial Comment:
Hi, 

We're running JBoss 3.2.3 with an Oracle XA datasource 
pooled witht the standard JBoss implementation. From 
time to time, the database goes down which results in 
several timeout exceptions from 
org.jboss.resource.adapter.jdbc.WrapperDataSource.get
Connection(WrapperDataSource.java:106) which of 
course is to be expected. In most cases things get back 
to normal when the database gets back up. Good. 

However, after this has happened a couple of times (we 
think it depends on the number of times connections are 
requested and unable to be served), we get this 
stacktrace: 

java.lang.ArrayIndexOutOfBoundsException: 10 
at 
org.jboss.resource.connectionmanager.InternalManagedC
onnectionPool.getConnection
(InternalManagedConnectionPool.java:163) 
at 
org.jboss.resource.connectionmanager.JBossManagedCon
nectionPool$BasePool.getConnection
(JBossManagedConnectionPool.java:496) 
at 
org.jboss.resource.connectionmanager.BaseConnectionM
anager2.getManagedConnection
(BaseConnectionManager2.java:425) 
at 
org.jboss.resource.connectionmanager.TxConnectionMan
ager.getManagedConnection
(TxConnectionManager.java:318) 
at 
org.jboss.resource.connectionmanager.BaseConnectionM
anager2.allocateConnection
(BaseConnectionManager2.java:477) 
at 
org.jboss.resource.connectionmanager.BaseConnectionM
anager2$ConnectionManagerProxy.allocateConnection
(BaseConnectionManager2.java:814) 
at 
org.jboss.resource.adapter.jdbc.WrapperDataSource.get
Connection(WrapperDataSource.java:102) 
at our.implementation.class.method(x) 
at sun.reflect.GeneratedMethodAccessor69.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$ContainerInterc
eptor.invoke(StatelessSessionContainer.java:683) 
at 
org.jboss.resource.connectionmanager.CachedConnectio
nInterceptor.invoke
(CachedConnectionInterceptor.java:185) 
at 
org.jboss.ejb.plugins.StatelessSessionInstanceIntercepto
r.invoke(StatelessSessionInstanceInterceptor.java:72) 
at 
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext
(AbstractTxInterceptor.java:84) 
at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransacti
ons(TxInterceptorCMT.java:267) 
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke
(TxInterceptorCMT.java:128) 
at org.jboss.ejb.plugins.SecurityInterceptor.invoke
(SecurityInterceptor.java:118) 
at org.jboss.ejb.plugins.LogInterceptor.invoke
(LogInterceptor.java:191) 
at 
org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invok
e(ProxyFactoryFinderInterceptor.java:122) 
at org.jboss.ejb.StatelessSessionContainer.internalInvoke
(StatelessSessionContainer.java:331) 
at org.jboss.ejb.Container.invoke(Container.java:700) 
at sun.reflect.GeneratedMethodAccessor65.invoke
(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:324) 
at 
org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke
(ReflectedMBeanDispatcher.java:284) 
at org.jboss.mx.server.MBeanServerImpl.invoke
(MBeanServerImpl.java:546) 
at org.jboss.invocation.local.LocalInvoker.invoke
(LocalInvoker.java:101) 
at org.jboss.invocation.InvokerInterceptor.invoke
(InvokerInterceptor.java:90) 
at org.jboss.proxy.TransactionInterceptor.invoke
(TransactionInterceptor.java:46) 
at org.jboss.proxy.SecurityInterceptor.invoke
(SecurityInterceptor.java:45) 
at 
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke
(StatelessSessionInterceptor.java:100) 
at org.jboss.proxy.ClientContainer.invoke
(ClientContainer.java:85) 
at $Proxy69.getDispatchRouteUpdates(Unknown Source) 
at 
com.glt.paperdist.backend.scheduletasks.BTDispatchDeliv
eryPollerTask.perform
(BTDispatchDeliveryPollerTask.java:30) 
at 
org.jboss.varia.scheduler.Scheduler$Listener.handleNotifi
cation(Scheduler.java:1263) 
at 
org.jboss.mx.server.NotificationListenerProxy.handleNotifi
cation(NotificationListenerProxy.java:69) 
at 
javax.management.NotificationBroadcasterSupport.sendN
otification(NotificationBroadcasterSupport.java:95) 
at javax.management.timer.Timer.sendNotifications
(Timer.java:441) 
at javax.management.timer.Timer.access$90
(Timer.java:31) 
at 
javax.management.timer.Timer$RegisteredNotification.do
Run(Timer.java:612) 
at org.jboss.mx.util.SchedulableRunnable.run
(SchedulableRunnable.java:164) 
at org.jboss.mx.util.ThreadPool$Worker.run
(ThreadPool.java:225) 

The pool has a max size of 10, so index 10 is of course 
invalid on InternalManagedConnectionPool on line 163: 

cl = cls[currentPoolIndex]; 

I see no code in InternalManagedConnectionPool that 
can cause the index to exceed maxSize since there are 
only two assignments to currentPoolIndex and they are 
1. syncrhonized and 2. cls[++currentPoolIndex] = cl; so 
that the out-of-bounds exception should have occured 
here. Very strange. 

In any case, there is something wrong - the MBean 
(belongs to the wrapping JBossManagedConnectionPool) 
currently shows that there are -18 connections in use... 
I would guess that there is some sort synchronization 
error in there somewhere. The current HEAD shows that 
the implementation of InternalManagedConnectionPool 
has changed quite a bit since the 3.2.3 branch. For 
instance, it no longer uses an array for holding the 
ConnectionListeners. We do not have the opportunity to 
test HEAD, but if these changes fixes our problems, I 
would suggest that it should be backported to 3.2.3. :) 

Cheers, 

Dag Liodden

----------------------------------------------------------------------

Comment By: Eduard Letifov (techtime)
Date: 2004-02-09 19:04

Message:
Logged In: YES 
user_id=438410

We seem to have simular problem also with Oracle XA on HP-
UX under load. In our case the pool is set to 30 and the 
database doesn't go "down", but here is what we get in the 
log (non-jboss part trimmed):

java.lang.ArrayIndexOutOfBoundsException: 30
        at 
org.jboss.resource.connectionmanager.InternalManagedConnec
tionPool.getConnection
(InternalManagedConnectionPool.java:162)
        at 
org.jboss.resource.connectionmanager.JBossManagedConnecti
onPool$BasePool.getConnection
(JBossManagedConnectionPool.java:496)
        at 
org.jboss.resource.connectionmanager.BaseConnectionManage
r2.getManagedConnection(BaseConnectionManager2.java:425)
        at 
org.jboss.resource.connectionmanager.TxConnectionManager.g
etManagedConnection(TxConnectionManager.java:318)
        at 
org.jboss.resource.connectionmanager.BaseConnectionManage
r2.allocateConnection(BaseConnectionManager2.java:477)
        at 
org.jboss.resource.connectionmanager.BaseConnectionManage
r2$ConnectionManagerProxy.allocateConnection
(BaseConnectionManager2.java:814)
        at 
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConne
ction(WrapperDataSource.java:102)

I see this was submitted pretty recently, is there any chance 
someone would look at this problem and at least indicate a 
direction on how to fix it? 


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=885095&group_id=22866


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to