views:

137

answers:

0

Even after successful transaction.Application connection with the database persist.in Hi , I am using Spring.Data.NHibernate12 on my database level.my application connection with database is not getting released. Underneath given is Dataconfiguration.xml

<?xml version="1.0" encoding="utf-8" ?>

<objects xmlns="http://www.springframework.net"
         xmlns:db="http://www.springframework.net/database"&gt;
  <object id="AuditLogger" type="Risco.Rsp.Ac.Audit.AuditLogger, Risco.Rsp.Ac.Audit" singleton="false">
    <property name="CacheSettings" ref="CacheSettings"/>
  </object>

  <object id="CacheSettings"
          type="Risco.Rsp.Ac.AMAC.CacheMgmt.Utilities.UpdateEntityCacheHelper, Risco.Rsp.Ac.AMAC.CacheMgmt.Utilities" singleton="false"/>

  <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core">
    <property name="ConfigSections" value="databaseSettings"/>
  </object>

  <db:provider id="AMACDbProvider"
                provider="OracleClient-2.0"
  connectionString="Data Source=DEVDB;User ID=amsbvt; Password=amsuser1234;"/>

  <!-- For creating Factory objects -->
  <object id="NHibernateSessionFactory"
   type="Spring.Data.NHibernate.LocalSessionFactoryObject,Spring.Data.NHibernate12">
    <property name="DbProvider" ref="AMACDbProvider"/>
    <property name="MappingAssemblies">

      <list>
        <value>Risco.Rsp.Ac.AMAC.Mapping</value>
        <value>Risco.Rsp.Ac.Logging.Appenders</value>
        <value>Risco.Rsp.Ac.AMAC.CacheMappings</value>
      </list>
    </property>
    <property name="HibernateProperties">
      <dictionary>

        <entry key="hibernate.connection.provider"
               value="NHibernate.Connection.DriverConnectionProvider"/>

        <entry key="hibernate.dialect"
               value="NHibernate.Dialect.Oracle9Dialect"/>

        <entry key="hibernate.connection.driver_class"
               value="NHibernate.Driver.OracleClientDriver"/>
      </dictionary>
    </property>
  </object>

  <object id="HibernateTemplate" type="Spring.Data.NHibernate.HibernateTemplate" singleton="false">
    <property name="SessionFactory" ref="NHibernateSessionFactory" />
    <property name="TemplateFlushMode" value="Auto" />
    <property name="CacheQueries" value="true" />
    <property name="EntityInterceptor" ref="AuditLogger"/>
  </object>

  <!-- To make use of spring's + nHibernate transaction management-->
  <object id="transactionManager" singleton="true"  type="Spring.Data.NHibernate.HibernateTransactionManager, Spring.Data.NHibernate12">
    <property name="DbProvider" ref="AMACDbProvider"/>
    <property name="SessionFactory" ref="NHibernateSessionFactory"/>
    <property name="EntityInterceptor" ref="AuditLogger"/>
  </object>


  <object id="CategoryDAOTx"   type="Spring.Transaction.Interceptor.TransactionProxyFactoryObject,Spring.Data">
    <property name="PlatformTransactionManager" ref="transactionManager"/>
    <property name="Target" ref="SendConfigDataDAO"/>
    <property name="TransactionAttributes">
      <name-values>
        <add key="Save" value="PROPAGATION_REQUIRED"/>
        <add key="Delete" value="PROPAGATION_REQUIRED"/>
        <add key="SaveOrUpdate" value="PROPAGATION_REQUIRED"/>
        <add key="FetchForUpdate" value="PROPAGATION_REQUIRED"/>
      </name-values>
    </property>
  </object>

  <object id="SendConfigDataDAO" type="Risco.Rsp.Ac.AMAC.DAO.SendConfigDataMgmt.SendConfigDataDAO,Risco.Rsp.Ac.AMAC.DAO.SendConfigDataMgmt">
    <property name="HibernateTemplate" ref="HibernateTemplate" />
    <property name="SessionFactory" ref="NHibernateSessionFactory"/>
  </object>

  <!--<tx:attribute-driven/>-->

</objects>

Please help me out with this issue.Thanks