I upgraded to the new db-ojb-1.0.4 which has the method
PersistenceBrokerFactoryFactory.instance().shutdown();
This results in exception:
[ERROR] mffweb] - Exception sending context destroyed event to listener
instance of class org.mff.web.listener.CleanupListener
<java.lang.NoSuchMethodError:
org.apache.ojb.broker.core.PersistenceBrokerThreadMapping.shutdown()V>java.lang.NoSuchMethodError:
org.apache.ojb.broker.core.PersistenceBrokerThreadMapping.shutdown()V
at
org.mff.web.listener.CleanupListener.contextDestroyed(CleanupListener.java:59)
Still have memory leak or (I suppose more accurtately, failure to clean
up resources). Anyone have any ideas or has anyone ever actually been
able to avoid this problem or am I just stuck with it?
Armin Waibel wrote:
Hi Rick,
Rick Roman wrote:
Sorry to be dense but can you send me the link to cvs for revision
1.4.2.2 of PersistenceBrokerFactoryIF? I'm having trouble locating it.
Think this will not work, because the changes will affect other
classes too.
http://www.mail-archive.com/ojb-dev@db.apache.org/msg01553.html
I recommend to use the latest from OJB 1.0.x branch (OJB_1_0_RELEASE
branch, trunk is unstable 1.x). The 1.0.x branch is 95% stable (the
test-suite show some odmg-api specific test failures, will be fixed
soon).
regards,
Armin
Ilkka Priha wrote:
Rick,
It was introduced in revision 1.4.2.2 of PersistenceBrokerFactoryIF
(25/07/05), so it's available only in the cvs version of OJB, but
hopefully quite soon also as 1.0.4-rc.
-- Ilkka
/**
* Shutdown method for OJB, kills all running processes within OJB -
after
* shutdown OJB can no longer be used.
* <br/>
* This method is introduced to solve hot/redeployment problems
(memory leaks) caused by
* the usage of [EMAIL PROTECTED] ThreadLocal} instances in OJB source and the
reuse of threads
* by the container (e.g. servlet- or ejb-container).
*/
public void shutdown();
Rick Roman wrote:
Hi Ilkka,
shutdown() does not appear to be a method of
PersistenceBrokerFactoryFactory.instance(). Is there a patch with
this available?
Ilkka Priha wrote:
Hi Rick,
Have you tried this one, it alone should do the job.
PersistenceBrokerFactoryFactory.instance().shutdown();
-- Ilkka
Rick Roman wrote:
Update: From other threads, I have tried using a contextDestroy
listener to run:
PersistenceBroker broker =
PersistenceBrokerFactory.defaultPersistenceBroker();
broker.clearCache();
broker.close();
PersistenceBrokerFactory.releaseAllInstances();
ConnectionFactoryFactory.getInstance().createConnectionFactory().releaseAllResources();
PersistenceBrokerThreadMapping.shutdown();
MetadataManager.getInstance().removeAllProfiles();
and the leak still persists.
Rick Roman wrote:
I am using OBJ to access PostgreSQL via a JNDI datasource. My
problem is that every time I reload my application context, I
get a big jump in Tomcat Perm Gen memory. After a several
reloads, tomcat eventually crashes with an out of memory error.
I believe this has to do with my OBJ configuration as I am able
to access the datasource without OBJ and I don't see the
problem. The memory leak problem is a known issue, discussed in
detail here:
http://opensource2.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669
In short, the problem is that "if any object that is loaded by
the system or container classloader (StandardClassLoader in
tomcat) still has a reference to the application class loader or
any object loaded by it, the class loader will not be garbage
collected. In that case, all the class objects and every object
referenced by a static field in any of the classes will not be
garbage collected."
Does anyone know how I can get rid of this behavior?
(repository.xml, OBJ.properties below)
repository.xml
<jdbc-connection-descriptor
jcd-alias="default"
default-connection="true"
platform="PostgreSQL"
jdbc-level="3.0"
jndi-datasource-name="java:comp/env/jdbc/mff/mffweb"
eager-release="false"
batch-mode="false"
useAutoCommit="1"
ignoreAutoCommitExceptions="false" > <object-cache
class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
<attribute attribute-name="cacheExcludes"
attribute-value=""/>
<attribute attribute-name="timeout" attribute-value="900"/>
<attribute attribute-name="autoSync"
attribute-value="true"/>
<attribute attribute-name="cachingKeyType"
attribute-value="0"/>
</object-cache>
<sequence-manager
className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl">
</sequence-manager>
</jdbc-connection-descriptor >
OBJ.properties
repositoryFile=repository.xml
useSerializedRepository=false
serializedRepositoryPath=.
PersistenceBrokerFactoryClass=org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl
PersistenceBrokerClass=org.apache.ojb.broker.core.PersistenceBrokerImpl
maxActive=256
maxIdle=-1
maxWait=2000
timeBetweenEvictionRunsMillis=-1
minEvictableIdleTimeMillis=1000000
whenExhaustedAction=0
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl
ConnectionManagerClass=org.apache.ojb.broker.accesslayer.ConnectionManagerImpl
SqlGeneratorClass=org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl
IndirectionHandlerClass=org.apache.ojb.broker.core.proxy.IndirectionHandlerDefaultImpl
ListProxyClass=org.apache.ojb.broker.core.proxy.ListProxyDefaultImpl
SetProxyClass=org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl
CollectionProxyClass=org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl
StatementManagerClass=org.apache.ojb.broker.accesslayer.StatementManager
JdbcAccessClass=org.apache.ojb.broker.accesslayer.JdbcAccessImpl
RowReaderDefaultClass=org.apache.ojb.broker.accesslayer.RowReaderDefaultImpl
descriptorBasedCaches=false
LockManagerClass=org.apache.ojb.broker.locking.LockManagerInMemoryImpl
LockTimeout=60000
OqlCollectionClass=org.apache.ojb.broker.util.collections.ManageableArrayList
SqlInLimit=200
ImplementationClass=org.apache.ojb.odmg.ImplementationImpl
OJBTxManagerClass=org.apache.ojb.odmg.LocalTxManager
cascadingDeleteOneToOne=false
cascadingDeleteOneToN=false
cascadingDeleteMToN=false
ImplicitLocking=true
LockAssociations=WRITE
DListClass=org.apache.ojb.odmg.collections.DListImpl
DArrayClass=org.apache.ojb.odmg.collections.DListImpl
DMapClass=org.apache.ojb.odmg.collections.DMapImpl
DBagClass=org.apache.ojb.odmg.collections.DBagImpl
DSetClass=org.apache.ojb.odmg.collections.DSetImpl
PersistentFieldClass=org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImplNew
JTATransactionManagerClass=org.apache.ojb.broker.transaction.tm.JBossTransactionManagerFactory
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
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]