Results 1 to 3 of 3

Thread: can't make caching work with Hibernate3 + ehcache

  1. #1
    Join Date
    Aug 2005
    Posts
    5

    Default can't make caching work with Hibernate3 + ehcache

    Based on the step-by-step guide from springframeworks.org, I have added hibernate+ehcache to see how caching work but it didn't seem to do the caching for me. When I hit refresh from my browser, I can see from the log that it is doing the JDBC call. ( my thought is unless I have update the table, otherwise, it should use the cache in memory then do the JDBC call and get the data from database again and again. I can also see from the log that it did cache the resultset everytime I refresh the scren.

    any help will be appreciated.

    here is my springapp-servlet.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    <!--  - Application context definition for "springapp" DispatcherServlet.  -->
    <beans>
    	<bean id="springappController" class="SpringappController">
             <property name="productManager">
                <ref bean="prodMan"/>
            </property>
       </bean>
    
        <!--  Validator and Form Controller for the "Price Increase" page -->
        <bean id="priceIncreaseValidator" class="com.mydomain.SpringTutorial.PriceIncreaseValidator"/>
        <bean id="priceIncreaseForm" class="com.mydomain.SpringTutorial.PriceIncreaseFormController">
            <property name="sessionForm"><value>true</value></property>
            <property name="commandName"><value>priceIncrease</value></property>
            <property name="commandClass"><value>com.mydomain.SpringTutorial.PriceIncrease</value></property>
            <property name="validator"><ref bean="priceIncreaseValidator"/></property>
            <property name="formView"><value>priceincrease</value></property>
            <property name="successView"><value>hello.htm</value></property>
            <property name="productManager">
                <ref bean="prodMan"/>
            </property>
        </bean>
    
       <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"
    		destroy-method="close" >
          <property name="driverClassName"><value>org.postgresql.Driver</value></property>
          <property name="url">
            <value>jdbc&#58;postgresql&#58;//localhost/spring</value>
          </property>
          <property name="username"><value>spring</value></property>
          <property name="password"><value></value></property>
        </bean>
    
        <bean id="sessionFactory" 
            class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingResources">
                <value>sample.hbm.xml</value>
            </property>
            <property name="entityCacheStrategies">
            	<props>
            		<prop key="com.mydomain.SpringTutorial.Product">read-write
            		</prop>
            	</props>
            </property>
             <property name="hibernateProperties">
                 <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                    <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
                    <prop key="hibernate.hibernate.cache.use_query_cache">true</prop>
                </props>
            </property>
        </bean>
    
       <bean id="productManagerDao" class="com.mydomain.SpringTutorial.db.HibernateProductManagerDao">
    	<property name="sessionFactory">
    		<ref bean="sessionFactory"/>
    	</property>
       </bean>
    
        <bean id="prodMan" class="com.mydomain.SpringTutorial.ProductManager">
            <property name="productManagerDao">
                <ref bean="productManagerDao"/>
            </property>
        </bean>
    
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename"><value>messages</value></property>
        </bean>
    
    	<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<props>
    				<prop key="/hello.htm">springappController</prop>
                    <prop key="/priceincrease.htm">priceIncreaseForm</prop>
    			</props>
    		</property>
    	</bean>
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
            <property name="prefix"><value>/WEB-INF/jsp/</value></property>
            <property name="suffix"><value>.jsp</value></property>
        </bean>
    
    </beans>
    Here is my sample.hbm.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE hibernate-mapping PUBLIC
            "-//Hibernate/Hibernate Mapping DTD//EN"
            "http&#58;//hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
        
    <hibernate-mapping auto-import="true">
        
        <class name="com.mydomain.SpringTutorial.Product" table="Products">
    	<cache usage="read-write"/>
    
            <id name="id" column="Id" type="int" unsaved-value="0">
                <generator class="sequence">
                    <param name=" sequence"> Products_Id_Seq</param>
                </generator>
            </id>
            <property name="description" column="Description"/>
            <property name="price" column="Price"/>
        </class>
        
    </hibernate-mapping>
    Here is my ehcache.xml
    Code:
    <ehcache>
    
       <defaultCache
            maxElementsInMemory="10000" 
            eternal="false" 
            timeToIdleSeconds="120" 
            timeToLiveSeconds="120" 
            overflowToDisk="true" 
            diskPersistent="false" 
            diskExpiryThreadIntervalSeconds="120" 
            /> 
    
        <!-- Standard Qurey Cache --> 
        <cache name="org.hibernate.cache.StandardQueryCache" 
            maxElementsInMemory="5" 
            eternal="false" 
            timeToLiveSeconds="120" 
            overflowToDisk="false"/> 
    
        <cache name="com.mydomain.SpringTutorial.Product" 
            maxElementsInMemory="100" 
            eternal="false" 
            timeToIdleSeconds="7200" 
            timeToLiveSeconds="7200" 
            overflowToDisk="false" 
            />
    
    </ehcache>

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Turn on the logging inside HB to see what exactly is doing. The docs for EhCache contain some nice tips on how to use cache using HB. Post your code also - not all methods use HB cache.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Aug 2005
    Posts
    5

    Default

    Here is the log
    Aug 25, 2005 10:48:16 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Aug 25, 2005 10:48:16 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1391 ms
    Aug 25, 2005 10:48:16 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Aug 25, 2005 10:48:16 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    Aug 25, 2005 10:48:16 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Aug 25, 2005 10:48:17 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
    INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/]
    Aug 25, 2005 10:48:17 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
    INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/acegi-security-sample-contacts-filter]
    Aug 25, 2005 10:48:18 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Aug 25, 2005 10:48:18 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    2005-08-25 22:48:18,734 INFO [org.springframework.web.servlet.DispatcherServlet] - <Initializing servlet 'SpringTutorial'>
    2005-08-25 22:48:18,843 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'SpringTutorial': initialization started>
    2005-08-25 22:48:18,843 INFO [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/SpringTutorial]] - <Loading WebApplicationContext for Spring FrameworkServlet 'SpringTutorial'>
    2005-08-25 22:48:18,937 INFO [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - <Loading XML bean definitions from ServletContext resource [/WEB-INF/SpringTutorial-servlet.xml]>
    2005-08-25 22:48:19,250 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - <Bean factory for application context [WebApplicationContext for namespace 'SpringTutorial-servlet']: org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [springappController,priceIncreaseValidator,priceIn creaseForm,dataSource,sessionFactory,productManage rDao,prodMan,messageSource,urlMapping,viewResolver]; root of BeanFactory hierarchy>
    2005-08-25 22:48:19,265 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - <10 beans defined in application context [WebApplicationContext for namespace 'SpringTutorial-servlet']>
    2005-08-25 22:48:19,281 INFO [org.springframework.core.CollectionFactory] - <JDK 1.4+ collections available>
    2005-08-25 22:48:19,281 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'messageSource'>
    2005-08-25 22:48:19,718 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - <Using MessageSource [org.springframework.context.support.ResourceBundle MessageSource: basenames=[messages]]>
    2005-08-25 22:48:19,718 INFO [org.springframework.web.context.support.XmlWebAppl icationContext] - <Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicatio nEventMulticaster@9ff0a8]>
    2005-08-25 22:48:19,718 INFO [org.springframework.ui.context.support.UiApplicati onContextUtils] - <No ThemeSource found for [WebApplicationContext for namespace 'SpringTutorial-servlet']: using ResourceBundleThemeSource>
    2005-08-25 22:48:19,734 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultL istableBeanFactory defining beans [springappController,priceIncreaseValidator,priceIn creaseForm,dataSource,sessionFactory,productManage rDao,prodMan,messageSource,urlMapping,viewResolver]; root of BeanFactory hierarchy]>
    2005-08-25 22:48:19,734 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'springappController'>
    2005-08-25 22:48:19,734 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'prodMan'>
    2005-08-25 22:48:19,734 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'productManagerDao'>
    2005-08-25 22:48:19,781 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'sessionFactory'>
    2005-08-25 22:48:19,812 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'dataSource'>
    2005-08-25 22:48:19,843 INFO [org.springframework.jdbc.datasource.DriverManagerD ataSource] - <Loaded JDBC driver: org.postgresql.Driver>
    2005-08-25 22:48:19,875 INFO [org.hibernate.cfg.Environment] - <Hibernate 3.1 beta 1>
    2005-08-25 22:48:19,875 INFO [org.hibernate.cfg.Environment] - <hibernate.properties not found>
    2005-08-25 22:48:19,875 INFO [org.hibernate.cfg.Environment] - <using CGLIB reflection optimizer>
    2005-08-25 22:48:19,875 INFO [org.hibernate.cfg.Environment] - <using JDK 1.4 java.sql.Timestamp handling>
    2005-08-25 22:48:20,171 DEBUG [org.hibernate.util.DTDEntityResolver] - <trying to locate http://hibernate.sourceforge.net/hib...apping-2.0.dtd in classpath under org/hibernate/>
    2005-08-25 22:48:20,171 DEBUG [org.hibernate.util.DTDEntityResolver] - <http://hibernate.sourceforge.net/hib...apping-2.0.dtd not found in classpath>
    2005-08-25 22:48:20,625 INFO [org.hibernate.cfg.HbmBinder] - <Mapping class: com.mydomain.SpringTutorial.Product -> Products>
    2005-08-25 22:48:20,625 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: id -> Id>
    2005-08-25 22:48:20,703 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: description -> Description>
    2005-08-25 22:48:20,703 DEBUG [org.hibernate.cfg.HbmBinder] - <Mapped property: price -> Price>
    2005-08-25 22:48:20,703 INFO [org.springframework.orm.hibernate3.LocalSessionFac toryBean] - <Building new Hibernate SessionFactory>
    2005-08-25 22:48:20,703 DEBUG [org.hibernate.cfg.Configuration] - <Preparing to build session factory with filters : {}>
    2005-08-25 22:48:20,703 INFO [org.hibernate.cfg.Configuration] - <processing extends queue>
    2005-08-25 22:48:20,703 INFO [org.hibernate.cfg.Configuration] - <processing collection mappings>
    2005-08-25 22:48:20,703 INFO [org.hibernate.cfg.Configuration] - <processing association property references>
    2005-08-25 22:48:20,703 INFO [org.hibernate.cfg.Configuration] - <processing foreign key constraints>
    2005-08-25 22:48:20,859 INFO [org.hibernate.connection.ConnectionProviderFactory] - <Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSource ConnectionProvider>
    2005-08-25 22:48:21,046 INFO [org.hibernate.cfg.SettingsFactory] - <RDBMS: PostgreSQL, version: 8.0.3>
    2005-08-25 22:48:21,046 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.0 JDBC3 with SSL (build 311)>
    2005-08-25 22:48:21,109 INFO [org.hibernate.dialect.Dialect] - <Using dialect: org.hibernate.dialect.PostgreSQLDialect>
    2005-08-25 22:48:21,140 INFO [org.hibernate.transaction.TransactionFactoryFactor y] - <Using default transaction strategy (direct JDBC transactions)>
    2005-08-25 22:48:21,140 INFO [org.hibernate.transaction.TransactionManagerLookup Factory] - <No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Automatic flush during beforeCompletion(): disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Automatic session close at end of transaction: disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC batch size: 15>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC batch updates for versioned data: disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Scrollable result sets: enabled>
    2005-08-25 22:48:21,140 DEBUG [org.hibernate.cfg.SettingsFactory] - <Wrap result sets: disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <JDBC3 getGeneratedKeys(): disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Connection release mode: null>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Default batch fetch size: 1>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Generate SQL with comments: disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Order SQL updates by primary key: disabled>
    2005-08-25 22:48:21,140 INFO [org.hibernate.cfg.SettingsFactory] - <Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory>
    2005-08-25 22:48:21,156 INFO [org.hibernate.hql.ast.ASTQueryTranslatorFactory] - <Using ASTQueryTranslatorFactory>
    2005-08-25 22:48:21,156 INFO [org.hibernate.cfg.SettingsFactory] - <Query language substitutions: {}>
    2005-08-25 22:48:21,156 INFO [org.hibernate.cfg.SettingsFactory] - <Second-level cache: enabled>
    2005-08-25 22:48:21,156 INFO [org.hibernate.cfg.SettingsFactory] - <Query cache: disabled>
    2005-08-25 22:48:21,156 INFO [org.hibernate.cfg.SettingsFactory] - <Cache provider: org.hibernate.cache.EhCacheProvider>
    2005-08-25 22:48:21,171 INFO [org.hibernate.cfg.SettingsFactory] - <Optimize cache for minimal puts: disabled>
    2005-08-25 22:48:21,171 INFO [org.hibernate.cfg.SettingsFactory] - <Structured second-level cache entries: disabled>
    2005-08-25 22:48:21,171 DEBUG [org.hibernate.exception.SQLExceptionConverterFacto ry] - <Using dialect defined converter>
    2005-08-25 22:48:21,187 INFO [org.hibernate.cfg.SettingsFactory] - <Echoing all SQL to stdout>
    2005-08-25 22:48:21,187 INFO [org.hibernate.cfg.SettingsFactory] - <Statistics: disabled>
    2005-08-25 22:48:21,187 INFO [org.hibernate.cfg.SettingsFactory] - <Deleted entity synthetic identifier rollback: disabled>
    2005-08-25 22:48:21,187 INFO [org.hibernate.cfg.SettingsFactory] - <Default entity-mode: pojo>
    2005-08-25 22:48:21,468 INFO [org.hibernate.impl.SessionFactoryImpl] - <building session factory>
    2005-08-25 22:48:21,468 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <Session factory constructed with filter configurations : {}>
    2005-08-25 22:48:21,468 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <instantiating session factory with properties: {java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.cache.provider_class=org.hibernate.cache .EhCacheProvider, sun.boot.library.path=C:\Java\jdk1.5.0_04\jre\bin, java.vm.version=1.5.0_04-b05, shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, tomcat.util.buf.StringCache.byte.enabled=true, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Java\eclipse-3.1, java.runtime.version=1.5.0_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironm ent, java.endorsed.dirs=C:\Java\jakarta-tomcat-5.5.9\common\endorsed, os.arch=x86, java.io.tmpdir=C:\Java\jakarta-tomcat-5.5.9\temp, line.separator=
    , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, java.naming.factory.url.pkgs=org.apache.naming, os.name=Windows XP, sun.jnu.encoding=MS950, java.library.path=C:\Java\jdk1.5.0_04\bin;.;C:\WIN DOWS\system32;C:\WINDOWS;C:\Perl\bin\;C:\WINDOWS\s ystem32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Sha reware\snmp\bin;C:\Java\apache-ant-1.6.5\bin, java.specification.name=Java Platform API Specification, java.class.version=49.0, sun.management.compiler=HotSpot Client Compiler, os.version=5.1, user.home=C:\Documents and Settings\Barrow, user.timezone=America/Los_Angeles, catalina.useNaming=true, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.5, catalina.home=C:\Java\jakarta-tomcat-5.5.9, java.class.path=C:\Java\jakarta-tomcat-5.5.9\bin\bootstrap.jar;C:\Java\jdk1.5.0_04\lib\to ols.jar, user.name=Barrow, hibernate.show_sql=true, java.naming.factory.initial=org.apache.naming.java .javaURLContextFactory, package.definition=sun.,java.,org.apache.catalina. ,org.apache.coyote.,org.apache.tomcat.,org.apache. jasper., java.vm.specification.version=1.0, hibernate.hibernate.cache.use_query_cache=true, java.home=C:\Java\jdk1.5.0_04\jre, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.PostgreSQL Dialect, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.5.0_04, java.ext.dirs=C:\Java\jdk1.5.0_04\jre\lib\ext, sun.boot.class.path=C:\Java\jakarta-tomcat-5.5.9\common\endorsed\xercesImpl.jar;C:\Java\jakar ta-tomcat-5.5.9\common\endorsed\xml-apis.jar;C:\Java\jdk1.5.0_04\jre\lib\rt.jar;C:\Jav a\jdk1.5.0_04\jre\lib\i18n.jar;C:\Java\jdk1.5.0_04 \jre\lib\sunrsasign.jar;C:\Java\jdk1.5.0_04\jre\li b\jsse.jar;C:\Java\jdk1.5.0_04\jre\lib\jce.jar;C:\ Java\jdk1.5.0_04\jre\lib\charsets.jar;C:\Java\jdk1 .5.0_04\jre\classes, server.loader=${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar, java.vendor=Sun Microsystems Inc., catalina.base=C:\Java\jakarta-tomcat-5.5.9, file.separator=\, hibernate.connection.provider_class=org.springfram ework.orm.hibernate3.LocalDataSourceConnectionProv ider, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, common.loader=${catalina.home}/common/classes,${catalina.home}/common/i18n/*.jar,${catalina.home}/common/endorsed/*.jar,${catalina.home}/common/lib/*.jar, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, package.access=sun.,org.apache.catalina.,org.apach e.coyote.,org.apache.tomcat.,org.apache.jasper.,su n.beans., sun.desktop=windows, sun.cpu.isalist=}>
    2005-08-25 22:48:22,093 DEBUG [org.hibernate.cache.CacheFactory] - <instantiating cache region: com.mydomain.SpringTutorial.Product usage strategy: read-write>
    2005-08-25 22:48:22,546 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Static SQL for entity: com.mydomain.SpringTutorial.Product>
    2005-08-25 22:48:22,546 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - < Version select: select Id from Products where Id =?>
    2005-08-25 22:48:22,546 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - < Snapshot select: select product_.Id, product_.Description as Descript2_0_, product_.Price as Price0_ from Products product_ where product_.Id=?>
    2005-08-25 22:48:22,546 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - < Insert 0: insert into Products (Description, Price, Id) values (?, ?, ?)>
    2005-08-25 22:48:22,546 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - < Update 0: update Products set Description=?, Price=? where Id=?>
    2005-08-25 22:48:22,546 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - < Delete 0: delete from Products where Id=?>
    2005-08-25 22:48:22,609 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity com.mydomain.SpringTutorial.Product: select product0_.Id as Id0_0_, product0_.Description as Descript2_0_0_, product0_.Price as Price0_0_ from Products product0_ where product0_.Id=?>
    2005-08-25 22:48:22,609 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity com.mydomain.SpringTutorial.Product: select product0_.Id as Id0_0_, product0_.Description as Descript2_0_0_, product0_.Price as Price0_0_ from Products product0_ where product0_.Id=?>
    2005-08-25 22:48:22,609 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity com.mydomain.SpringTutorial.Product: select product0_.Id as Id0_0_, product0_.Description as Descript2_0_0_, product0_.Price as Price0_0_ from Products product0_ where product0_.Id=? for update>
    2005-08-25 22:48:22,609 DEBUG [org.hibernate.loader.entity.EntityLoader] - <Static select for entity com.mydomain.SpringTutorial.Product: select product0_.Id as Id0_0_, product0_.Description as Descript2_0_0_, product0_.Price as Price0_0_ from Products product0_ where product0_.Id=? for update>
    2005-08-25 22:48:22,609 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - <initializing class SessionFactoryObjectFactory>
    2005-08-25 22:48:22,625 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] - <registered: 4028528805f154590105f1545ed10000 (unnamed)>
    2005-08-25 22:48:22,625 INFO [org.hibernate.impl.SessionFactoryObjectFactory] - <Not binding factory to JNDI, no JNDI name configured>
    2005-08-25 22:48:22,625 DEBUG [org.hibernate.impl.SessionFactoryImpl] - <instantiated session factory>
    2005-08-25 22:48:22,625 INFO [org.hibernate.impl.SessionFactoryImpl] - <Checking 0 named queries>
    2005-08-25 22:48:22,687 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'priceIncreaseValidator'>
    2005-08-25 22:48:22,687 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'priceIncreaseForm'>
    2005-08-25 22:48:22,750 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'urlMapping'>
    2005-08-25 22:48:22,781 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'viewResolver'>
    2005-08-25 22:48:22,859 INFO [org.springframework.web.servlet.DispatcherServlet] - <Using context class [org.springframework.web.context.support.XmlWebAppl icationContext] for servlet 'SpringTutorial'>
    2005-08-25 22:48:22,859 INFO [org.springframework.web.servlet.DispatcherServlet] - <Unable to locate MultipartResolver with name 'multipartResolver': no multipart request handling provided>
    2005-08-25 22:48:22,859 INFO [org.springframework.web.servlet.DispatcherServlet] - <Unable to locate LocaleResolver with name 'localeResolver': using default [org.springframework.web.servlet.i18n.AcceptHeaderL ocaleResolver@14b84c7]>
    2005-08-25 22:48:22,859 INFO [org.springframework.web.servlet.DispatcherServlet] - <Unable to locate ThemeResolver with name 'themeResolver': using default [org.springframework.web.servlet.theme.FixedThemeRe solver@31688f]>
    2005-08-25 22:48:22,875 INFO [org.springframework.web.servlet.DispatcherServlet] - <No HandlerAdapters found in servlet 'SpringTutorial': using default>
    2005-08-25 22:48:22,875 INFO [org.springframework.web.servlet.DispatcherServlet] - <FrameworkServlet 'SpringTutorial': initialization completed in 4032 ms>
    2005-08-25 22:48:22,875 INFO [org.springframework.web.servlet.DispatcherServlet] - <Servlet 'SpringTutorial' configured successfully>
    Aug 25, 2005 10:48:23 PM org.apache.catalina.core.ApplicationContext log
    INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRul e: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterR ule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingR ule: Redirect URL: http://jakarta.apache.org]]
    Aug 25, 2005 10:48:23 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Aug 25, 2005 10:48:23 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Aug 25, 2005 10:48:23 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
    INFO: Missing application web.xml, using defaults only StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mytest]
    Aug 25, 2005 10:48:23 PM org.apache.catalina.startup.ContextConfig validateSecurityRoles
    INFO: WARNING: Security role name tomcat used in an <auth-constraint> without being defined in a <security-role>
    Aug 25, 2005 10:48:23 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Aug 25, 2005 10:48:24 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    Aug 25, 2005 10:48:24 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/156 config=null
    Aug 25, 2005 10:48:24 PM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    Aug 25, 2005 10:48:24 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 7766 ms
    2005-08-25 22:48:32,375 INFO [SpringappController] - <returning hello view with Thu Aug 25 22:48:32 PDT 2005>
    2005-08-25 22:48:32,468 INFO [org.springframework.beans.factory.xml.XmlBeanDefin itionReader] - <Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'DB2'>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'HSQL'>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'MS-SQL'>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'MySQL'>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'Oracle'>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'Informix'>
    2005-08-25 22:48:32,500 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'PostgreSQL'>
    2005-08-25 22:48:32,515 INFO [org.springframework.beans.factory.support.DefaultL istableBeanFactory] - <Creating shared instance of singleton bean 'Sybase'>
    2005-08-25 22:48:32,515 INFO [org.springframework.jdbc.support.SQLErrorCodesFact ory] - <SQLErrorCodes loaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]>
    2005-08-25 22:48:32,703 DEBUG [org.hibernate.impl.SessionImpl] - <opened session at timestamp: 4608144640253952>
    2005-08-25 22:48:32,718 DEBUG [org.hibernate.impl.SessionImpl] - <find: from Product>
    2005-08-25 22:48:32,718 DEBUG [org.hibernate.engine.QueryParameters] - <named parameters: {}>
    2005-08-25 22:48:32,859 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <parse() - HQL: from com.mydomain.SpringTutorial.Product>
    2005-08-25 22:48:32,875 DEBUG [org.hibernate.hql.ast.AST] - <--- HQL AST ---
    \-[QUERY] 'query'
    \-[SELECT_FROM] 'SELECT_FROM'
    \-[FROM] 'from'
    \-[RANGE] 'RANGE'
    \-[DOT] '.'
    +-[DOT] '.'
    | +-[DOT] '.'
    | | +-[IDENT] 'com'
    | | \-[IDENT] 'mydomain'
    | \-[IDENT] 'SpringTutorial'
    \-[IDENT] 'Product'
    >
    2005-08-25 22:48:32,875 DEBUG [org.hibernate.hql.ast.ErrorCounter] - <throwQueryException() : no errors>
    2005-08-25 22:48:32,968 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - <select << begin [level=1, statement=select]>
    2005-08-25 22:48:33,015 DEBUG [org.hibernate.hql.ast.tree.FromElement] - <FromClause{level=1} : com.mydomain.SpringTutorial.Product (no alias) -> product0_>
    2005-08-25 22:48:33,015 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - <select : finishing up [level=1, statement=select]>
    2005-08-25 22:48:33,015 DEBUG [org.hibernate.hql.ast.HqlSqlWalker] - <processQuery() : ( SELECT ( FromClause{level=1} Products product0_ ) )>
    2005-08-25 22:48:33,046 DEBUG [org.hibernate.hql.ast.HqlSqlWalker] - <Derived SELECT clause created.>
    2005-08-25 22:48:33,062 DEBUG [org.hibernate.hql.ast.util.JoinProcessor] - <Using FROM fragment [Products product0_]>
    2005-08-25 22:48:33,062 DEBUG [org.hibernate.hql.antlr.HqlSqlBaseWalker] - <select >> end [level=1, statement=select]>
    2005-08-25 22:48:33,062 DEBUG [org.hibernate.hql.ast.AST] - <--- SQL AST ---
    \-[SELECT] QueryNode: 'SELECT' querySpaces (Products)
    +-[SELECT_CLAUSE] SelectClause: '{derived select clause}'
    | +-[SELECT_EXPR] SelectExpressionImpl: 'product0_.Id as Id0_' {FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=Pro ducts,tableAlias=product0_,colums={,className=com. mydomain.SpringTutorial.Product}}}
    | \-[SQL_TOKEN] SqlFragment: 'product0_.Description as Descript2_0_, product0_.Price as Price0_'
    \-[FROM] FromClause: 'from' FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[], fromElementByTableAlias=[product0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
    \-[FROM_FRAGMENT] FromElement: 'Products product0_' FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=null,role=null,tableName=Pro ducts,tableAlias=product0_,colums={,className=com. mydomain.SpringTutorial.Product}}
    >
    2005-08-25 22:48:33,062 DEBUG [org.hibernate.hql.ast.ErrorCounter] - <throwQueryException() : no errors>
    2005-08-25 22:48:33,078 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <HQL: from com.mydomain.SpringTutorial.Product>
    2005-08-25 22:48:33,078 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <SQL: select product0_.Id as Id0_, product0_.Description as Descript2_0_, product0_.Price as Price0_ from Products product0_>
    2005-08-25 22:48:33,078 DEBUG [org.hibernate.hql.ast.ErrorCounter] - <throwQueryException() : no errors>
    2005-08-25 22:48:33,093 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
    2005-08-25 22:48:33,093 DEBUG [org.hibernate.jdbc.ConnectionManager] - <opening JDBC connection>
    2005-08-25 22:48:33,125 DEBUG [org.hibernate.SQL] - <select product0_.Id as Id0_, product0_.Description as Descript2_0_, product0_.Price as Price0_ from Products product0_>
    Hibernate: select product0_.Id as Id0_, product0_.Description as Descript2_0_, product0_.Price as Price0_ from Products product0_
    2005-08-25 22:48:33,125 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <preparing statement>
    2005-08-25 22:48:33,203 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open ResultSet (open ResultSets: 0, globally: 0)>
    2005-08-25 22:48:33,203 DEBUG [org.hibernate.loader.Loader] - <processing result set>
    2005-08-25 22:48:33,203 DEBUG [org.hibernate.loader.Loader] - <result set row: 0>
    2005-08-25 22:48:33,203 DEBUG [org.hibernate.type.IntegerType] - <returning '2' as column: Id0_>
    2005-08-25 22:48:33,203 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:33,203 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:33,218 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Hydrating entity: [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:33,218 DEBUG [org.hibernate.type.StringType] - <returning 'Table' as column: Descript2_0_>
    2005-08-25 22:48:33,218 DEBUG [org.hibernate.type.DoubleType] - <returning '75.29' as column: Price0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <result set row: 1>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.type.IntegerType] - <returning '3' as column: Id0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Hydrating entity: [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.type.StringType] - <returning 'Chair' as column: Descript2_0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.type.DoubleType] - <returning '22.81' as column: Price0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <result set row: 2>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.type.IntegerType] - <returning '1' as column: Id0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Hydrating entity: [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.type.StringType] - <returning 'Lamp' as column: Descript2_0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.type.DoubleType] - <returning '7.13' as column: Price0_>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <done processing result set (3 rows)>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close ResultSet (open ResultSets: 1, globally: 1)>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <closing statement>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.loader.Loader] - <total objects hydrated: 3>
    2005-08-25 22:48:33,234 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:33,250 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <adding entity to second-level cache: [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.ReadWriteCache] - <Caching: com.mydomain.SpringTutorial.Product#2>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.EhCache] - <key: com.mydomain.SpringTutorial.Product#2>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.EhCache] - <Element for com.mydomain.SpringTutorial.Product#2 is null>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.ReadWriteCache] - <Cached: com.mydomain.SpringTutorial.Product#2>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <done materializing entity [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <adding entity to second-level cache: [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.ReadWriteCache] - <Caching: com.mydomain.SpringTutorial.Product#3>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.EhCache] - <key: com.mydomain.SpringTutorial.Product#3>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.EhCache] - <Element for com.mydomain.SpringTutorial.Product#3 is null>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.ReadWriteCache] - <Cached: com.mydomain.SpringTutorial.Product#3>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <done materializing entity [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <adding entity to second-level cache: [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.ReadWriteCache] - <Caching: com.mydomain.SpringTutorial.Product#1>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.EhCache] - <key: com.mydomain.SpringTutorial.Product#1>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.EhCache] - <Element for com.mydomain.SpringTutorial.Product#1 is null>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.cache.ReadWriteCache] - <Cached: com.mydomain.SpringTutorial.Product#1>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <done materializing entity [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:33,281 DEBUG [org.hibernate.engine.StatefulPersistenceContext] - <initializing non-lazy collections>
    2005-08-25 22:48:33,296 DEBUG [org.hibernate.jdbc.JDBCContext] - <after autocommit>
    2005-08-25 22:48:33,296 DEBUG [org.hibernate.impl.SessionImpl] - <after transaction completion>
    2005-08-25 22:48:33,296 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <flushing session>
    2005-08-25 22:48:33,296 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <processing flush-time cascades>
    2005-08-25 22:48:33,359 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <dirty checking collections>
    2005-08-25 22:48:33,359 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Flushing entities and processing referenced collections>
    2005-08-25 22:48:33,375 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Processing unreferenced collections>
    2005-08-25 22:48:33,375 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Scheduling collection removes/(re)creates/updates>
    2005-08-25 22:48:33,375 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects>
    2005-08-25 22:48:33,375 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.pretty.Printer] - <listing entities:>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.pretty.Printer] - <com.mydomain.SpringTutorial.Product{price=7.13, description=Lamp, id=1}>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.pretty.Printer] - <com.mydomain.SpringTutorial.Product{price=75.29 , description=Table, id=2}>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.pretty.Printer] - <com.mydomain.SpringTutorial.Product{price=22.81 , description=Chair, id=3}>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <executing flush>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <post flush>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.impl.SessionImpl] - <closing session>
    2005-08-25 22:48:33,390 DEBUG [org.hibernate.jdbc.ConnectionManager] - <closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
    2005-08-25 22:48:33,406 DEBUG [org.hibernate.jdbc.JDBCContext] - <after transaction completion>
    2005-08-25 22:48:33,406 DEBUG [org.hibernate.impl.SessionImpl] - <after transaction completion>
    2005-08-25 22:48:38,656 INFO [SpringappController] - <returning hello view with Thu Aug 25 22:48:38 PDT 2005>
    2005-08-25 22:48:38,656 DEBUG [org.hibernate.impl.SessionImpl] - <opened session at timestamp: 4608144665214976>
    2005-08-25 22:48:38,671 DEBUG [org.hibernate.impl.SessionImpl] - <find: from Product>
    2005-08-25 22:48:38,671 DEBUG [org.hibernate.engine.QueryParameters] - <named parameters: {}>
    2005-08-25 22:48:38,671 DEBUG [org.hibernate.hql.ast.QueryTranslatorImpl] - <compile() : The query is already compiled, skipping...>
    2005-08-25 22:48:38,671 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open PreparedStatement (open PreparedStatements: 0, globally: 0)>
    2005-08-25 22:48:38,671 DEBUG [org.hibernate.jdbc.ConnectionManager] - <opening JDBC connection>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.SQL] - <select product0_.Id as Id0_, product0_.Description as Descript2_0_, product0_.Price as Price0_ from Products product0_>
    Hibernate: select product0_.Id as Id0_, product0_.Description as Descript2_0_, product0_.Price as Price0_ from Products product0_
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <preparing statement>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to open ResultSet (open ResultSets: 0, globally: 0)>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <processing result set>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <result set row: 0>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.IntegerType] - <returning '2' as column: Id0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Hydrating entity: [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.StringType] - <returning 'Table' as column: Descript2_0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.DoubleType] - <returning '75.29' as column: Price0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <result set row: 1>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.IntegerType] - <returning '3' as column: Id0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Hydrating entity: [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.StringType] - <returning 'Chair' as column: Descript2_0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.DoubleType] - <returning '22.81' as column: Price0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <result set row: 2>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.type.IntegerType] - <returning '1' as column: Id0_>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <result row: EntityKey[com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.loader.Loader] - <Initializing object from ResultSet: [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:38,703 DEBUG [org.hibernate.persister.entity.BasicEntityPersiste r] - <Hydrating entity: [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.type.StringType] - <returning 'Lamp' as column: Descript2_0_>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.type.DoubleType] - <returning '7.13' as column: Price0_>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.loader.Loader] - <done processing result set (3 rows)>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close ResultSet (open ResultSets: 1, globally: 1)>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <about to close PreparedStatement (open PreparedStatements: 1, globally: 1)>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.jdbc.AbstractBatcher] - <closing statement>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.loader.Loader] - <total objects hydrated: 3>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <adding entity to second-level cache: [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.ReadWriteCache] - <Caching: com.mydomain.SpringTutorial.Product#2>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.EhCache] - <key: com.mydomain.SpringTutorial.Product#2>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.ReadWriteCache] - <Item was already cached: com.mydomain.SpringTutorial.Product#2>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <done materializing entity [com.mydomain.SpringTutorial.Product#2]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <adding entity to second-level cache: [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.ReadWriteCache] - <Caching: com.mydomain.SpringTutorial.Product#3>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.EhCache] - <key: com.mydomain.SpringTutorial.Product#3>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.ReadWriteCache] - <Item was already cached: com.mydomain.SpringTutorial.Product#3>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <done materializing entity [com.mydomain.SpringTutorial.Product#3]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <resolving associations for [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <adding entity to second-level cache: [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.ReadWriteCache] - <Caching: com.mydomain.SpringTutorial.Product#1>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.EhCache] - <key: com.mydomain.SpringTutorial.Product#1>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.cache.ReadWriteCache] - <Item was already cached: com.mydomain.SpringTutorial.Product#1>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.TwoPhaseLoad] - <done materializing entity [com.mydomain.SpringTutorial.Product#1]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.engine.StatefulPersistenceContext] - <initializing non-lazy collections>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.jdbc.JDBCContext] - <after autocommit>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.impl.SessionImpl] - <after transaction completion>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <flushing session>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <processing flush-time cascades>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <dirty checking collections>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Flushing entities and processing referenced collections>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Processing unreferenced collections>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Scheduling collection removes/(re)creates/updates>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.pretty.Printer] - <listing entities:>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.pretty.Printer] - <com.mydomain.SpringTutorial.Product{price=7.13, description=Lamp, id=1}>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.pretty.Printer] - <com.mydomain.SpringTutorial.Product{price=75.29 , description=Table, id=2}>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.pretty.Printer] - <com.mydomain.SpringTutorial.Product{price=22.81 , description=Chair, id=3}>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <executing flush>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.event.def.AbstractFlushingEventListe ner] - <post flush>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.impl.SessionImpl] - <closing session>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.jdbc.ConnectionManager] - <closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.jdbc.JDBCContext] - <after transaction completion>
    2005-08-25 22:48:38,718 DEBUG [org.hibernate.impl.SessionImpl] - <after transaction completion>
    Here is com.mydomain.SpringTutorial.db.HibernateProductMan agerDao
    Code:
    package com.mydomain.SpringTutorial.db;
    
    import java.util.List;
    
    import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
    
    import com.mydomain.SpringTutorial.Product;
    
    public class HibernateProductManagerDao extends HibernateDaoSupport implements
    		ProductManagerDao &#123;
    
    	public List getProductList&#40;&#41; &#123;
    		return getHibernateTemplate&#40;&#41;.find&#40;"from Product"&#41;;
    	&#125;
    
    	public Product getById&#40;int id&#41;&#123;
    		return &#40;Product&#41;getHibernateTemplate&#40;&#41;.load&#40;Product.class, new Integer&#40;id&#41;&#41;;
    	&#125;
    	public void increasePrice&#40;Product prod, int pct&#41; &#123;
    		// TODO Auto-generated method stub
    
    	&#125;
    
    &#125;
    com.mydomain.SpringTutorial.Product.java
    Code:
    package com.mydomain.SpringTutorial;
    
    import java.io.Serializable;
    
    public class Product implements Serializable &#123;
    
    	/**
    	 * 
    	 */
    	private static final long serialVersionUID = 1L;
    
    	private int id;
        private String description;
        private Double price;
        
        public void setId&#40;int i&#41;&#123;
        	id = i;
        &#125;
        
        public int getId&#40;&#41;&#123;
        	return id;
        &#125;
        
        public void setDescription&#40;String s&#41; &#123;
        	description = s;
        &#125;
        
        public String getDescription&#40;&#41; &#123;
        	return description;
        &#125;
        
        public void setPrice&#40;Double d&#41; &#123;
        	price = d;
        &#125;
        
        public Double getPrice&#40;&#41; &#123;
        	return price;
        &#125;
    &#125;
    com.mydomain.SpringTutorial.ProductManager.java
    Code:
    package com.mydomain.SpringTutorial;
    
    import java.io.Serializable;
    import java.util.List;
    import java.util.ListIterator;
    
    import com.mydomain.SpringTutorial.db.ProductManagerDao;
    
    public class ProductManager implements Serializable &#123;
    
    	/**
    	 * 
    	 */
    	private static final long serialVersionUID = 1L;
    
        private List products;
        private ProductManagerDao pmd;
        
        public void setProductManagerDao&#40;ProductManagerDao pmd&#41; &#123;
        	this.pmd = pmd;
        &#125;
    
    /*	public void setProducts&#40;List p&#41; &#123;
        	products = p;
        &#125;
    */
        
        public List getProducts&#40;&#41; &#123;
        	products = pmd.getProductList&#40;&#41;;
        	return products;
        &#125;
    
        public void increasePrice&#40;int pct&#41; &#123;
            ListIterator li = products.listIterator&#40;&#41;;
            while &#40;li.hasNext&#40;&#41;&#41; &#123;
                Product p = &#40;Product&#41; li.next&#40;&#41;;
    /*            double newPrice = p.getPrice&#40;&#41;.doubleValue&#40;&#41; * &#40;100 + pct&#41;/100;
                p.setPrice&#40;new Double&#40;newPrice&#41;&#41;;
    */
                pmd.increasePrice&#40;p,pct&#41;;
            &#125;
            
        &#125;
    
    &#125;
    com.mydomain.SpringTutorial.PriceIncreaseFormContr oller.java
    Code:
    package com.mydomain.SpringTutorial;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.SimpleFormController;
    import org.springframework.web.servlet.view.RedirectView;
    
    public class PriceIncreaseFormController extends SimpleFormController &#123;
        /** Logger for this class and subclasses */
    	protected final Log logger = LogFactory.getLog&#40;getClass&#40;&#41;&#41;;
    	private ProductManager prodMan;
    	
    	public ModelAndView onSubmit&#40;Object command&#41;
    		throws ServletException &#123;
    		int increase = &#40;&#40;PriceIncrease&#41; command&#41;.getPercentage&#40;&#41;;
    		logger.info&#40;"Increasing prices by " + increase + "%."&#41;;
    		prodMan.increasePrice&#40;increase&#41;;
    		String now = &#40;new java.util.Date&#40;&#41;&#41;.toString&#40;&#41;;
    		logger.info&#40;"returning from PriceIncreaseForm view to " + getSuccessView&#40;&#41; +
    				" with " + now&#41;;
    		Map myModel = new HashMap&#40;&#41;;
    		myModel.put&#40;"now", now&#41;;
    		myModel.put&#40;"products", getProductManager&#40;&#41;.getProducts&#40;&#41;&#41;;
    		return new ModelAndView&#40;new RedirectView&#40;getSuccessView&#40;&#41;&#41;&#41;;
    	&#125;
    	
    	protected Object formBackingObject&#40;HttpServletRequest request&#41; throws ServletException &#123;
    		PriceIncrease priceIncrease = new PriceIncrease&#40;&#41;;
    		priceIncrease.setPercentage&#40;20&#41;;
    		return priceIncrease;
    	&#125;
    	
    	public void setProductManager&#40;ProductManager pm&#41; &#123;
    		prodMan = pm;
    	&#125;
    	
    	public ProductManager getProductManager&#40;&#41; &#123;
    		return prodMan;
    	&#125;
    &#125;

Similar Threads

  1. Replies: 1
    Last Post: Jun 12th, 2005, 08:46 AM
  2. Replies: 4
    Last Post: Mar 28th, 2005, 04:00 AM
  3. strategies for caching persistent data
    By news in forum Architecture
    Replies: 3
    Last Post: Jan 14th, 2005, 02:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •