hi!
now i tried to fix the crash (posting from some days ago). for that, i 
modified class BrokerPool. when a PB is requested, it is checked, if the 
PB is closed. in this case, a new PB is created and the old one of the 
Vector is replaced with the new one. the new PB will be returned. the code 
seems to work for me (in my cases). does anyone expect any sideeffects on 
this implementation?

here my modification:

    int getFreeBrokerId()
    {
        synchronized (freeBrokerIds)
        {
            while (freeBrokerIds.isEmpty())
            {
                try
                {
                    freeBrokerIds.wait();
                }
                catch (InterruptedException e)
                {
                    continue;
                }
            }
            int result = ((Integer) freeBrokerIds.remove(0)).intValue();
            if (logger.isDebugEnabled()) logger.debug("getFreeBrokerId: " 
+ result);

            if( ( ( PersistenceBrokerImpl ) brokers.get( result ) 
).isClosed() )
            {
                logger.debug( "creating new PersistenceBroker for id " + 
result );

                PBKey key = new PBKey( repositoryFile );
                PersistenceBroker pb = new PersistenceBrokerImpl(key, 
PersistenceBrokerFactoryFactory.instance() );
                brokers.setElementAt( pb, result );
            }

            return result;
        }
    }

juergen

--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to