Hi Gary,

>
> Is there a need to synchronize on the object(s)?

hmm, no synchronize shouldn't be necessary because PB instance isn't threadsafe all in all. Maybe the object was reclaimed by GC after the ref.get() call.
Are you sure that each thread operates on its own PB instance while running your test?


regards,
Armin

Gary wrote:
While running a multi-threaded stress test, I received
the following exception:

java.lang.NullPointerException
        at java.lang.Throwable.<init>(Throwable.java)
        at java.lang.Throwable.<init>(Throwable.java)
        at
java.lang.NullPointerException.<init>(NullPointerException.java:60)
        at
org.apache.ojb.broker.accesslayer.RsIterator$ResourceWrapper.beforeClose(RsIterator.java)
        at
org.apache.ojb.broker.core.PersistenceBrokerAbstractImpl.notifiyStateListener(PersistenceBrokerAbstractImpl.java)

It looks like "ref" or "ref.get()" became null after
the check in the following method:

public void beforeClose(PBStateEvent event)
{
if(ref != null && ref.get() != null)
{
((RsIterator)ref.get()).releaseDbResources();
ref = null;
}
}


Is there a need to synchronize on the object(s)?

Gary

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to