It�s in CVS.
________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, March 09, 2005 6:17 AM
To: [EMAIL PROTECTED]; [email protected]
Cc: [EMAIL PROTECTED]
Subject: [Andromda-devel] Possible resource leaks?
Hi Chad,
I think I have a problem somewhat related to JIRA issue SPRING-36: it is a
feature request that I made (and I thank you for implementing it).
The problem appears only when the andromda-spring-cartridge's 'session-ejbs'
namespace property is false (not using EJBs).
Before you implemented my request:
------------------------------------------------------
The generated ServiceLocator was responsible for instantiating an
ApplicationContext.
The problem is this context (ClassPathXmlApplicationContext, which is a
ConfigurableApplicationContext) was never close()d.
This means that if the ApplicationContext contained DisposableBeans or beans
with a 'destroy-method' attribute, their "destroy" method would never be
called and their resources would never be released. E.g.: a local pooling
DataSource, a org.springframework.scheduling.timer.TimerFactoryBean, ...
After you implemented my request:
------------------------------------------------------
The ServiceLocator has been reimplemented to delegate the ApplicationContext
creation to a ContextSingletonBeanFactoryLocator and now accesses the
ApplicationContext through a BeanFactoryReference.
The problem remains because BeanFactoryReference.release() is never called
anywhere. This method decrements the reference counter and closes the
ApplicationContext once it reaches 0.
Note: This method is automatically called in
org.springframework.ejb.support.AbstractEnterpriseBean.ejbRemove() (a super
class of org.springframework.ejb.support.AbstractStatelessSessionBean).
One solution would be to add the following method to the ServiceLocator
singleton, and call it when the web application is stopped:
public synchronized void destroy() {
�������if (beanFactoryReference != null) {
������������beanFactoryReference.release();
� � � � beanFactoryReference = null;
�������}
}
What do you think?
Thanks in advance,
Johnny
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Andromda-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-devel