Yea, I will do that. But its still unsolved, so if anybody has got some solution, please feel free to guide me. Thank you..
On Thu, Feb 14, 2008 at 4:18 PM, Ian Roughley <[EMAIL PROTECTED]> wrote: > This question will probably result in an answer / better solution if > asked on the Spring forums. > > > /Ian > > -- > Ian Roughley > From Down & Around, Inc. > Consulting * Training / Mentoring * Agile Process * Open Source > web: http://www.fdar.com - email: [EMAIL PROTECTED] > > > > Rushikesh Thakkar wrote: > > > > Thanks Ian and Laurie for looking into this. > > Excuse me Laurie, for missing out an imp. info. that "web.xml also contains > > spring ContextLoaderListener declaration". > > > > I now feel that it is more a spring / tomcat issue and not a really a > > struts2 issue. > > I observed the tomcat's console logs while it was shutting down. I could > see > > the info messages indicating that the spring context was being destroyed. > > But when I 'reload' the context of the same web-app using Tomcat Manager > > application, I don't see those info messages. > > > > So, I guess I need to > > either change the way tomcat reloads the context (only if it's possible) > > or find out a way to reload spring context when Tomcat reloads the > > web-app context. > > > > Correct me if I'm wrong. Direct me if I'm right.. :) > > > > - Rushikesh > > > > On Wed, Feb 13, 2008 at 9:29 PM, Laurie Harper <[EMAIL PROTECTED]> wrote: > > > > > >> > (3) web.xml doesn't contain anything but struts2 filter declaration. > >> > >> If that's the case, how is Spring getting initialized? Usually you would > >> configure one of Spring's context listeners, which will take care of > >> loading the Spring context on startup and destroying it when the > >> application is shut down / undeployed. > >> > >> As Ian indicated, you'll need *some* sort of context listener to close > >> the Spring context (i.e. reverse whatever Spring setup logic you have), > >> whether it be one of the ones supplied by Spring or your own. > >> > >> L. > >> > >> Rushikesh Thakkar wrote: > >> > >>> I want to release a database connection while reloading the context > >>> > >> (using > >> > >>> Tomcat Manager web app) of a Struts2 Web Application. I am also using > >>> > >> Spring > >> > >>> and hibernate. (Spring's HibernateTemplate, Spring SessionFactory and > >>> > >> Apache > >> > >>> Commons-dbcp with HSql standalone-database) > >>> > >>> As I am using HSql 'standalone' database, even if the web application > >>> context gets reloaded, the database connection is not released while > >>> destroying the context. So I get 'Database is already in use by other > >>> process' error. I want to know whether there is any way to implement > >>> something like "destroy() method of servlet" in a Struts2 application. > >>> > >>> I am not sure whether I can do it with spring configuration. Any idea? > >>> > >> If > >> > >>> there are many ways of doing it, kindly also tell which way is the best > >>> > >> for > >> > >>> me. > >>> > >>> (1) struts.properties: > >>> > >>> struts.objectFactory = > >>> > >> org.apache.struts2.spring.StrutsSpringObjectFactory > >> > >>> (2) applicationContext.xml (my spring configuration file) > >>> > >>> <beans default-autowire="autodetect"> > >>> > >>> <bean id="myDataSource" class=" > >>> > >> org.apache.commons.dbcp.BasicDataSource" > >> > >>> destroy-method="close"> > >>> <property name="driverClassName" value="org.hsqldb.jdbcDriver" > >>> > >> /> > >> > >>> <property name="url" > >>> value="jdbc:hsqldb:file:C:/Projects/db/hsqlTest" /> > >>> <property name="username" value="sa"/> > >>> <property name="password" value=""/> > >>> </bean> > >>> <bean id="mySessionFactory" class=" > >>> org.springframework.orm.hibernate3.LocalSessionFactoryBean"> > >>> <property name="dataSource" ref="myDataSource"/> > >>> <property name="mappingResources"> > >>> <list> > >>> > >>> > >>> > >> <value>no/bbs/webservice/client/config/model/certificate.hbm.xml</value> > >> > >>> </property> > >>> <property name="hibernateProperties"> > >>> <props> > >>> <prop key="hibernate.dialect"> > >>> org.hibernate.dialect.HSQLDialect</prop> > >>> <prop key="hibernate.show_sql">true</prop> > >>> </props> > >>> </property> > >>> </bean> > >>> > >>> <bean id="hibernateTemplate" class=" > >>> org.springframework.orm.hibernate3.HibernateTemplate"> > >>> <property name="sessionFactory"> > >>> <ref bean="mySessionFactory"/> > >>> </property> > >>> </bean> > >>> <bean id="testClientDao" class=" > >>> webservice.client.dao.hibernate.TestClientDAO"> > >>> <property name="hibernateTemplate"> > >>> <ref bean="hibernateTemplate"/> > >>> </property> > >>> </bean> > >>> <!-- Some Strus2-Actions follow --> > >>> </beans> > >>> > >>> (3) web.xml doesn't contain anything but struts2 filter declaration. > >>> > >>> > >> --------------------------------------------------------------------- > >> 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]