Hi,
I'm trying to assert whether the second level cache is working. I understand (or at least I think I do) the theory behind the cache (from the docs) but am unable to convince myself that I am actually hitting it.
I have a simple Class:
Entity
Code:
public class Entity {
private String name;
private Integer id;
/**
* Contructor.
*/
public Entity() {
super();
}
public String getName() {
return name;
}
public void setName(String string) {
name = string;
}
public Integer getId() {
return id;
}
public void setId(Integer integer) {
id = integer;
}
}
My
mapping file is as follows:
Code:
<hibernate-mapping>
<class name="test.Entity"
proxy="test.Entity"
table="publication">
<!-- ehcache usage -->
<cache usage="read-only" />
<id name="id" type="java.lang.Integer" unsaved-value="null" >
<column name="publication_id" sql-type="int(11)" not-null="true"/>
<generator class="native"/>
</id>
<property name="name">
<column name="name" sql-type="varchar(200)" not-null="true"/>
</property>
</class>
</hibernate-mapping>
My
hibernate.cfg.xml looks like
Code:
<hibernate-configuration>
<!-- a SessionFactory instance -->
<session-factory>
<!-- properties -->
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost/communication?autoReconnect=true</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">password</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<!-- Use ehcache as a caching tool -->
<property name="hibernate.cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<!-- Mapping files -->
<mapping resource="Entity.hbm.xml"/>
</session-factory>
</hibernate-configuration>
I also have
ehcache.xml on my classpath with the following entry
Code:
<cache name="test.Entity"
maxElementsInMemory="200"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
overflowToDisk="true"
/>
I am executing a block of code containing repeating method calls, each using a new session and transaction, but the same sessionfactory (and vm of course):
Code:
File configFile = new File("c:\\temp\\hibernate.cfg.xml");
if (!configFile.exists()) {
throw new FileNotFoundException("The config file was not found");
}
Configuration config = new Configuration();
SessionFactory sf =
new Configuration().configure(configFile).buildSessionFactory();
Session sess = sf.openSession();
Transaction tx = null;
log.info("Checking all Entitys the first time");
try {
tx = sess.beginTransaction();
List entityList = sess.find("from Entity");
for (Iterator iter = entityList.iterator(); iter.hasNext(); ) {
Entity e = (Entity)iter.next();
e.getName();
System.out.print(".");
}
System.out.println();
tx.commit();
} catch (Exception e) {
if (tx != null)
tx.rollback();
throw e;
} finally {
sess.close();
}
log.info("Checking all Entitys the second time");
sess = sf.openSession();
try {
tx = sess.beginTransaction();
List entityList = sess.find("from Entity");
for (Iterator iter = entityList.iterator(); iter.hasNext(); ) {
Entity e = (Entity)iter.next();
e.getName();
System.out.print(".");
}
System.out.println();
tx.commit();
} catch (Exception e) {
if (tx != null)
tx.rollback();
throw e;
} finally {
sess.close();
}
log.info("Checking all Entitys the third time (using createQuery())");
sess = sf.openSession();
try {
tx = sess.beginTransaction();
List entityList = sess.createQuery("from Entity").setCacheable(true).list();
for (Iterator iter = entityList.iterator(); iter.hasNext(); ) {
Entity e = (Entity)iter.next();
e.getName();
System.out.print(".");
}
System.out.println();
tx.commit();
} catch (Exception e) {
if (tx != null)
tx.rollback();
throw e;
} finally {
sess.close();
}
log.info("Checking all Entitys the third time (using createQuery() after caching)");
sess = sf.openSession();
try {
tx = sess.beginTransaction();
List entityList = sess.createQuery("from Entity").setCacheable(true).list();
for (Iterator iter = entityList.iterator(); iter.hasNext(); ) {
Entity e = (Entity)iter.next();
e.getName();
System.out.print(".");
}
System.out.println();
tx.commit();
} catch (Exception e) {
if (tx != null)
tx.rollback();
throw e;
} finally {
sess.close();
}
}
and I get the following
log outputCode:
17:39:29,720 INFO net.sf.hibernate.cfg.Environment:432 - Hibernate 2.1.1
17:39:29,730 INFO net.sf.hibernate.cfg.Environment:461 - hibernate.properties not found
17:39:29,740 INFO net.sf.hibernate.cfg.Environment:481 - using CGLIB reflection optimizer
17:39:29,760 INFO net.sf.hibernate.cfg.Configuration:877 - configuring from file: hibernate.cfg.xml
17:39:30,771 DEBUG net.sf.hibernate.util.DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd in classpath under net/sf/hibernate/
17:39:30,872 DEBUG net.sf.hibernate.util.DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd in classpath
17:39:31,052 DEBUG net.sf.hibernate.cfg.Configuration:801 - hibernate.connection.driver_class=com.mysql.jdbc.Driver
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - hibernate.connection.url=jdbc:mysql://localhost/communication?autoReconnect=true
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - hibernate.connection.username=commserver_user
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - hibernate.connection.password=commserver
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - dialect=net.sf.hibernate.dialect.MySQLDialect
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - show_sql=true
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - use_outer_join=true
17:39:31,062 DEBUG net.sf.hibernate.cfg.Configuration:801 - hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider
17:39:31,072 DEBUG net.sf.hibernate.cfg.Configuration:952 - null<-org.dom4j.tree.DefaultAttribute@10f6d3 [Attribute: name resource value "Entity.hbm.xml"]
17:39:31,082 INFO net.sf.hibernate.cfg.Configuration:300 - Mapping resource: Entity.hbm.xml
17:39:31,112 DEBUG net.sf.hibernate.util.DTDEntityResolver:20 - trying to locate http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath under net/sf/hibernate/
17:39:31,122 DEBUG net.sf.hibernate.util.DTDEntityResolver:29 - found http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd in classpath
17:39:31,422 INFO net.sf.hibernate.cfg.Binder:225 - Mapping class: test.Entity -> publication
17:39:31,432 DEBUG net.sf.hibernate.cache.CacheFactory:32 - cache for: test.Entity usage strategy: read-only
17:39:31,432 WARN net.sf.hibernate.cache.CacheFactory:36 - read-only cache configured for mutable: test.Entity
17:39:31,603 DEBUG net.sf.hibernate.cfg.Binder:449 - Mapped property: id -> publication_id, type: integer
17:39:31,643 DEBUG net.sf.hibernate.cfg.Binder:449 - Mapped property: name -> name, type: string
17:39:31,653 INFO net.sf.hibernate.cfg.Configuration:998 - Configured SessionFactory: null
17:39:31,653 DEBUG net.sf.hibernate.cfg.Configuration:999 - properties: {hibernate.connection.password=commserver, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, sun.boot.library.path=C:\dev\java\j2sdk1.4.2_02\jre\bin, java.vm.version=1.4.2_02-b03, hibernate.connection.username=commserver_user, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, use_outer_join=true, user.country=ZA, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\dev\eclipse\workspace\CommServer-2_0, java.runtime.version=1.4.2_02-b03, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\dev\java\j2sdk1.4.2_02\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\justin\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.java2d.fontpath=, java.library.path=C:\dev\java\j2sdk1.4.2_02\bin;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\GNU\WinCvs 1.3\CVSNT;C:\dev\java\jwsdp-1.2\jwsdp-shared\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.0, user.home=C:\Documents and Settings\justin, user.timezone=GMT+02:00, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=com.mysql.jdbc.Driver, show_sql=true, user.name=justin, java.class.path=C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\classes;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\c3p0.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\cglib2.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-digester.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-fileupload-1.0.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\cryptix32.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\dom4j.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\ehcache.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\exinet-reader.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\exinet-test.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\gcomp.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\hibernate2.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\itext-0.96.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\jasperreports-0.5.0.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\jdom.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\junit.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\odmg.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\pager-taglib.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\spring.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\struts.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\endorsed\xmlParserAPIs.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\endorsed\xercesImpl.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\endorsed\mysql-connector.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\servlet.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\ant.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-collections.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-dbcp-1.1.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-logging-api.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-pool-1.1.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jasper-compiler.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jasper-runtime.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jdbc2_0-stdext.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jndi.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jta.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\mail.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\naming-common.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\naming-factory.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\naming-resources.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\activation.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-lang.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-beanutils.jar;C:\dev\eclipse\workspace\CommServer_ADI_NISSAN\WEB-INF\lib\log4j.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-logging.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\dev\java\j2sdk1.4.2_02\jre, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.connection.url=jdbc:mysql://localhost/communication?autoReconnect=true, 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.4.2_02, java.ext.dirs=C:\dev\java\j2sdk1.4.2_02\jre\lib\ext, sun.boot.class.path=C:\dev\java\j2sdk1.4.2_02\jre\lib\rt.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\sunrsasign.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\jsse.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\jce.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\charsets.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\dnsns.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\ldapsec.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\localedata.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\sunjce_provider.jar, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.use_outer_join=true, dialect=net.sf.hibernate.dialect.MySQLDialect, sun.cpu.isalist=pentium i486 i386}
17:39:31,653 INFO net.sf.hibernate.cfg.Configuration:584 - processing one-to-many association mappings
17:39:31,653 INFO net.sf.hibernate.cfg.Configuration:593 - processing one-to-one association property references
17:39:31,683 INFO net.sf.hibernate.cfg.Configuration:618 - processing foreign key constraints
17:39:31,733 INFO net.sf.hibernate.dialect.Dialect:82 - Using dialect: net.sf.hibernate.dialect.MySQLDialect
17:39:31,733 INFO net.sf.hibernate.cfg.SettingsFactory:62 - Use outer join fetching: true
17:39:31,753 INFO net.sf.hibernate.connection.DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
17:39:31,753 INFO net.sf.hibernate.connection.DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
17:39:31,763 INFO net.sf.hibernate.connection.DriverManagerConnectionProvider:71 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/communication?autoReconnect=true
17:39:31,763 INFO net.sf.hibernate.connection.DriverManagerConnectionProvider:72 - connection properties: {user=commserver_user, password=commserver}
17:39:31,773 INFO net.sf.hibernate.transaction.TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
17:39:31,793 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:78 - total checked-out connections: 0
17:39:31,793 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:94 - opening new JDBC connection
17:39:32,774 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:100 - created connection to: jdbc:mysql://localhost/communication?autoReconnect=true, Isolation Level: 2
17:39:32,884 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:114 - returning connection to pool, pool size: 1
17:39:32,884 INFO net.sf.hibernate.cfg.SettingsFactory:89 - Use scrollable result sets: true
17:39:32,884 INFO net.sf.hibernate.cfg.SettingsFactory:90 - JDBC 2 max batch size: 15
17:39:32,894 INFO net.sf.hibernate.cfg.SettingsFactory:96 - echoing all SQL to stdout
17:39:32,894 INFO net.sf.hibernate.cfg.SettingsFactory:99 - Query language substitutions: {}
17:39:32,894 INFO net.sf.hibernate.cfg.SettingsFactory:110 - cache provider: net.sf.ehcache.hibernate.Provider
17:39:32,904 INFO net.sf.hibernate.cfg.Configuration:1057 - instantiating and configuring caches
17:39:32,904 DEBUG net.sf.hibernate.cfg.Configuration:1064 - instantiating cache test.Entity
17:39:32,914 DEBUG net.sf.ehcache.CacheManager:177 - Creating new CacheManager with default config
17:39:32,925 DEBUG net.sf.ehcache.CacheManager:151 - Configuring ehcache from classpath.
17:39:32,945 DEBUG net.sf.ehcache.config.Configurator:118 - Configuring ehcache from ehcache.xml found in the classpath: file:/C:/dev/eclipse/workspace/CommServer-2_0/WEB-INF/classes/ehcache.xml
17:39:32,955 DEBUG net.sf.ehcache.config.Configuration$DiskStore:169 - Disk Store Path: C:\DOCUME~1\justin\LOCALS~1\Temp\
17:39:33,065 DEBUG net.sf.ehcache.store.MemoryStore:124 - exinet.biscotti.communication.contentinstance.ContentInstance Cache: Using SpoolingLinkedHashMap implementation
17:39:33,075 DEBUG net.sf.ehcache.store.MemoryStore:104 - initialized MemoryStore for exinet.biscotti.communication.contentinstance.ContentInstance
17:39:33,075 DEBUG net.sf.ehcache.store.MemoryStore:124 - test.Entity Cache: Using SpoolingLinkedHashMap implementation
17:39:33,075 DEBUG net.sf.ehcache.store.MemoryStore:104 - initialized MemoryStore for test.Entity
17:39:33,395 INFO net.sf.hibernate.impl.SessionFactoryImpl:119 - building session factory
17:39:33,395 DEBUG net.sf.hibernate.impl.SessionFactoryImpl:125 - instantiating session factory with properties: {hibernate.connection.password=commserver, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider, sun.boot.library.path=C:\dev\java\j2sdk1.4.2_02\jre\bin, java.vm.version=1.4.2_02-b03, hibernate.connection.username=commserver_user, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, use_outer_join=true, user.country=ZA, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\dev\eclipse\workspace\CommServer-2_0, java.runtime.version=1.4.2_02-b03, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.endorsed.dirs=C:\dev\java\j2sdk1.4.2_02\jre\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\justin\LOCALS~1\Temp\, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows 2000, sun.java2d.fontpath=, java.library.path=C:\dev\java\j2sdk1.4.2_02\bin;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\GNU\WinCvs 1.3\CVSNT;C:\dev\java\jwsdp-1.2\jwsdp-shared\bin, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.0, user.home=C:\Documents and Settings\justin, user.timezone=GMT+02:00, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.connection.driver_class=com.mysql.jdbc.Driver, show_sql=true, user.name=justin, java.class.path=C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\classes;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\c3p0.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\cglib2.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-digester.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-fileupload-1.0.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\cryptix32.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\dom4j.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\ehcache.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\exinet-reader.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\exinet-test.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\gcomp.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\hibernate2.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\itext-0.96.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\jasperreports-0.5.0.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\jdom.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\junit.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\odmg.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\pager-taglib.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\spring.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\struts.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\endorsed\xmlParserAPIs.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\endorsed\xercesImpl.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\endorsed\mysql-connector.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\servlet.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\ant.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-collections.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-dbcp-1.1.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-logging-api.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\commons-pool-1.1.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jasper-compiler.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jasper-runtime.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jdbc2_0-stdext.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jndi.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\jta.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\mail.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\naming-common.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\naming-factory.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\naming-resources.jar;C:\dev\servers\tomcat\jakarta-tomcat-4.1.29\common\lib\activation.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-lang.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-beanutils.jar;C:\dev\eclipse\workspace\CommServer_ADI_NISSAN\WEB-INF\lib\log4j.jar;C:\dev\eclipse\workspace\CommServer-2_0\WEB-INF\lib\commons-logging.jar, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\dev\java\j2sdk1.4.2_02\jre, sun.arch.data.model=32, hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect, hibernate.connection.url=jdbc:mysql://localhost/communication?autoReconnect=true, 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.4.2_02, java.ext.dirs=C:\dev\java\j2sdk1.4.2_02\jre\lib\ext, sun.boot.class.path=C:\dev\java\j2sdk1.4.2_02\jre\lib\rt.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\sunrsasign.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\jsse.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\jce.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\charsets.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\dnsns.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\ldapsec.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\localedata.jar;C:\dev\java\j2sdk1.4.2_02\jre\lib\ext\sunjce_provider.jar, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.use_outer_join=true, dialect=net.sf.hibernate.dialect.MySQLDialect, sun.cpu.isalist=pentium i486 i386}
17:39:34,397 DEBUG net.sf.hibernate.impl.SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
17:39:34,407 DEBUG net.sf.hibernate.impl.SessionFactoryObjectFactory:76 - registered: 2c9081d1fa33efbb00fa33efc07d0000 (unnamed)
17:39:34,417 INFO net.sf.hibernate.impl.SessionFactoryObjectFactory:82 - no JNDI name configured
17:39:34,417 DEBUG net.sf.hibernate.impl.SessionFactoryImpl:196 - instantiated session factory
17:39:34,587 DEBUG net.sf.hibernate.impl.SessionImpl:528 - opened session
17:39:34,597 INFO test.HibernateTest:64 - Checking all Entitys the first time
17:39:34,597 DEBUG net.sf.hibernate.transaction.JDBCTransaction:37 - begin
17:39:34,597 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:78 - total checked-out connections: 0
17:39:34,667 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:84 - using pooled JDBC connection, pool size: 0
17:39:34,667 DEBUG net.sf.hibernate.transaction.JDBCTransaction:41 - current autocommit status:false
17:39:34,677 DEBUG net.sf.hibernate.impl.SessionImpl:1460 - find: from Entity
17:39:34,717 DEBUG net.sf.hibernate.hql.QueryTranslator:147 - compiling query
17:39:34,757 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:34,757 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:34,757 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:34,757 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:34,827 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
17:39:34,827 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:34,837 DEBUG net.sf.hibernate.impl.SessionImpl:1745 - Dont need to execute flush
17:39:34,837 DEBUG net.sf.hibernate.hql.QueryTranslator:199 - HQL: from test.Entity
17:39:34,837 DEBUG net.sf.hibernate.hql.QueryTranslator:200 - SQL: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:34,847 DEBUG net.sf.hibernate.impl.BatcherImpl:192 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:39:34,847 DEBUG net.sf.hibernate.SQL:223 - select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
Hibernate: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:34,847 DEBUG net.sf.hibernate.impl.BatcherImpl:227 - preparing statement
17:39:34,887 DEBUG net.sf.hibernate.loader.Loader:196 - processing result set
17:39:34,897 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '2' as column: publicat1_
17:39:34,897 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 2
17:39:34,897 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 2
17:39:34,897 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#2
17:39:34,907 DEBUG net.sf.hibernate.type.StringType:68 - returning 'TEST' as column: name
17:39:34,907 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '19' as column: publicat1_
17:39:34,907 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 19
17:39:34,907 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 19
17:39:34,917 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#19
17:39:34,917 DEBUG net.sf.hibernate.type.StringType:68 - returning '34 Applet Demo' as column: name
17:39:34,917 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '46' as column: publicat1_
17:39:34,917 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 46
17:39:34,997 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 46
17:39:34,997 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#46
17:39:34,997 DEBUG net.sf.hibernate.type.StringType:68 - returning 'Shafieks publication' as column: name
17:39:34,997 DEBUG net.sf.hibernate.loader.Loader:225 - done processing result set (3 rows)
17:39:35,008 DEBUG net.sf.hibernate.impl.BatcherImpl:199 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:39:35,008 DEBUG net.sf.hibernate.impl.BatcherImpl:240 - closing statement
17:39:35,008 DEBUG net.sf.hibernate.loader.Loader:238 - total objects hydrated: 3
17:39:35,018 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#2]
17:39:35,018 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#2]
17:39:35,018 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 2
17:39:35,028 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#2]
17:39:35,028 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#19]
17:39:35,028 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#19]
17:39:35,028 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 19
17:39:35,038 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#19]
17:39:35,038 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#46]
17:39:35,038 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#46]
17:39:35,038 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 46
17:39:35,038 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#46]
17:39:35,038 DEBUG net.sf.hibernate.impl.SessionImpl:3000 - initializing non-lazy collections
...
17:39:35,048 DEBUG net.sf.hibernate.transaction.JDBCTransaction:59 - commit
17:39:35,048 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,048 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,048 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,048 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,058 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
17:39:35,058 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,058 DEBUG net.sf.hibernate.impl.Printer:75 - listing entities:
17:39:35,058 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=34 Applet Demo, id=19}
17:39:35,058 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=TEST, id=2}
17:39:35,058 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=Shafieks publication, id=46}
17:39:35,058 DEBUG net.sf.hibernate.impl.SessionImpl:2258 - executing flush
17:39:35,058 DEBUG net.sf.hibernate.impl.SessionImpl:2708 - post flush
17:39:35,068 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,068 DEBUG net.sf.hibernate.impl.SessionImpl:546 - closing session
17:39:35,068 DEBUG net.sf.hibernate.impl.SessionImpl:3187 - disconnecting session
17:39:35,078 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:114 - returning connection to pool, pool size: 1
17:39:35,078 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,078 INFO test.HibernateTest:86 - Checking all Entitys the second time
17:39:35,078 DEBUG net.sf.hibernate.impl.SessionImpl:528 - opened session
17:39:35,078 DEBUG net.sf.hibernate.transaction.JDBCTransaction:37 - begin
17:39:35,078 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:78 - total checked-out connections: 0
17:39:35,078 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:84 - using pooled JDBC connection, pool size: 0
17:39:35,158 DEBUG net.sf.hibernate.transaction.JDBCTransaction:41 - current autocommit status:false
17:39:35,158 DEBUG net.sf.hibernate.impl.SessionImpl:1460 - find: from Entity
17:39:35,158 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,158 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,168 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,168 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,168 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
17:39:35,168 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,168 DEBUG net.sf.hibernate.impl.SessionImpl:1745 - Dont need to execute flush
17:39:35,168 DEBUG net.sf.hibernate.hql.QueryTranslator:199 - HQL: from test.Entity
17:39:35,168 DEBUG net.sf.hibernate.hql.QueryTranslator:200 - SQL: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:35,178 DEBUG net.sf.hibernate.impl.BatcherImpl:192 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:39:35,178 DEBUG net.sf.hibernate.SQL:223 - select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
Hibernate: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:35,178 DEBUG net.sf.hibernate.impl.BatcherImpl:227 - preparing statement
17:39:35,178 DEBUG net.sf.hibernate.loader.Loader:196 - processing result set
17:39:35,178 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '2' as column: publicat1_
17:39:35,188 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 2
17:39:35,188 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 2
17:39:35,188 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#2
17:39:35,188 DEBUG net.sf.hibernate.type.StringType:68 - returning 'TEST' as column: name
17:39:35,188 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '19' as column: publicat1_
17:39:35,188 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 19
17:39:35,188 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 19
17:39:35,198 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#19
17:39:35,198 DEBUG net.sf.hibernate.type.StringType:68 - returning '34 Applet Demo' as column: name
17:39:35,208 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '46' as column: publicat1_
17:39:35,208 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 46
17:39:35,208 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 46
17:39:35,208 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#46
17:39:35,208 DEBUG net.sf.hibernate.type.StringType:68 - returning 'Shafieks publication' as column: name
17:39:35,208 DEBUG net.sf.hibernate.loader.Loader:225 - done processing result set (3 rows)
17:39:35,218 DEBUG net.sf.hibernate.impl.BatcherImpl:199 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:39:35,218 DEBUG net.sf.hibernate.impl.BatcherImpl:240 - closing statement
17:39:35,218 DEBUG net.sf.hibernate.loader.Loader:238 - total objects hydrated: 3
17:39:35,218 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#2]
17:39:35,218 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#2]
17:39:35,218 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 2
17:39:35,218 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#2]
17:39:35,218 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#19]
17:39:35,218 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#19]
17:39:35,228 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 19
17:39:35,228 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#19]
17:39:35,228 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#46]
17:39:35,228 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#46]
17:39:35,228 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 46
17:39:35,228 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#46]
17:39:35,228 DEBUG net.sf.hibernate.impl.SessionImpl:3000 - initializing non-lazy collections
...
17:39:35,238 DEBUG net.sf.hibernate.transaction.JDBCTransaction:59 - commit
17:39:35,238 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,238 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,238 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,238 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,238 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
17:39:35,238 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,238 DEBUG net.sf.hibernate.impl.Printer:75 - listing entities:
17:39:35,248 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=34 Applet Demo, id=19}
17:39:35,248 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=TEST, id=2}
17:39:35,248 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=Shafieks publication, id=46}
17:39:35,248 DEBUG net.sf.hibernate.impl.SessionImpl:2258 - executing flush
17:39:35,248 DEBUG net.sf.hibernate.impl.SessionImpl:2708 - post flush
17:39:35,248 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,248 DEBUG net.sf.hibernate.impl.SessionImpl:546 - closing session
17:39:35,328 DEBUG net.sf.hibernate.impl.SessionImpl:3187 - disconnecting session
17:39:35,328 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:114 - returning connection to pool, pool size: 1
17:39:35,328 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,328 INFO test.HibernateTest:109 - Checking all Entitys the third time (using createQuery())
17:39:35,328 DEBUG net.sf.hibernate.impl.SessionImpl:528 - opened session
17:39:35,328 DEBUG net.sf.hibernate.transaction.JDBCTransaction:37 - begin
17:39:35,338 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:78 - total checked-out connections: 0
17:39:35,338 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:84 - using pooled JDBC connection, pool size: 0
17:39:35,338 DEBUG net.sf.hibernate.transaction.JDBCTransaction:41 - current autocommit status:false
17:39:35,358 DEBUG net.sf.hibernate.impl.SessionImpl:1460 - find: from Entity
17:39:35,358 DEBUG net.sf.hibernate.engine.QueryParameters:108 - named parameters: {}
17:39:35,358 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,358 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,358 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,368 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,368 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
17:39:35,368 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,368 DEBUG net.sf.hibernate.impl.SessionImpl:1745 - Dont need to execute flush
17:39:35,368 DEBUG net.sf.hibernate.hql.QueryTranslator:199 - HQL: from test.Entity
17:39:35,368 DEBUG net.sf.hibernate.impl.SessionImpl:3239 - running Session.finalize()
17:39:35,378 DEBUG net.sf.hibernate.hql.QueryTranslator:200 - SQL: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:35,378 DEBUG net.sf.hibernate.impl.BatcherImpl:192 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:39:35,378 DEBUG net.sf.hibernate.SQL:223 - select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
Hibernate: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:35,378 DEBUG net.sf.hibernate.impl.BatcherImpl:227 - preparing statement
17:39:35,378 DEBUG net.sf.hibernate.loader.Loader:196 - processing result set
17:39:35,378 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '2' as column: publicat1_
17:39:35,378 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 2
17:39:35,388 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 2
17:39:35,388 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#2
17:39:35,388 DEBUG net.sf.hibernate.type.StringType:68 - returning 'TEST' as column: name
17:39:35,388 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '19' as column: publicat1_
17:39:35,388 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 19
17:39:35,388 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 19
17:39:35,388 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#19
17:39:35,398 DEBUG net.sf.hibernate.type.StringType:68 - returning '34 Applet Demo' as column: name
17:39:35,398 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '46' as column: publicat1_
17:39:35,398 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 46
17:39:35,398 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 46
17:39:35,398 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#46
17:39:35,408 DEBUG net.sf.hibernate.type.StringType:68 - returning 'Shafieks publication' as column: name
17:39:35,408 DEBUG net.sf.hibernate.loader.Loader:225 - done processing result set (3 rows)
17:39:35,408 DEBUG net.sf.hibernate.impl.BatcherImpl:199 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:39:35,408 DEBUG net.sf.hibernate.impl.BatcherImpl:240 - closing statement
17:39:35,408 DEBUG net.sf.hibernate.loader.Loader:238 - total objects hydrated: 3
17:39:35,408 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#2]
17:39:35,408 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#2]
17:39:35,408 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 2
17:39:35,418 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#2]
17:39:35,418 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#19]
17:39:35,418 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#19]
17:39:35,418 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 19
17:39:35,418 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#19]
17:39:35,418 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#46]
17:39:35,418 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#46]
17:39:35,498 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 46
17:39:35,498 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#46]
17:39:35,498 DEBUG net.sf.hibernate.impl.SessionImpl:3000 - initializing non-lazy collections
...
17:39:35,498 DEBUG net.sf.hibernate.transaction.JDBCTransaction:59 - commit
17:39:35,498 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,508 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,508 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,508 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,508 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
17:39:35,508 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,508 DEBUG net.sf.hibernate.impl.Printer:75 - listing entities:
17:39:35,518 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=34 Applet Demo, id=19}
17:39:35,518 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=TEST, id=2}
17:39:35,528 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=Shafieks publication, id=46}
17:39:35,528 DEBUG net.sf.hibernate.impl.SessionImpl:2258 - executing flush
17:39:35,528 DEBUG net.sf.hibernate.impl.SessionImpl:2708 - post flush
17:39:35,528 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,528 DEBUG net.sf.hibernate.impl.SessionImpl:546 - closing session
17:39:35,528 DEBUG net.sf.hibernate.impl.SessionImpl:3187 - disconnecting session
17:39:35,538 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:114 - returning connection to pool, pool size: 1
17:39:35,538 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,538 INFO test.HibernateTest:132 - Checking all Entitys the third time (using createQuery() after caching)
17:39:35,538 DEBUG net.sf.hibernate.impl.SessionImpl:528 - opened session
17:39:35,538 DEBUG net.sf.hibernate.transaction.JDBCTransaction:37 - begin
17:39:35,538 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:78 - total checked-out connections: 0
17:39:35,538 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:84 - using pooled JDBC connection, pool size: 0
17:39:35,538 DEBUG net.sf.hibernate.transaction.JDBCTransaction:41 - current autocommit status:false
17:39:35,538 DEBUG net.sf.hibernate.impl.SessionImpl:1460 - find: from Entity
17:39:35,548 DEBUG net.sf.hibernate.engine.QueryParameters:108 - named parameters: {}
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,548 DEBUG net.sf.hibernate.impl.SessionImpl:1745 - Dont need to execute flush
17:39:35,558 DEBUG net.sf.hibernate.hql.QueryTranslator:199 - HQL: from test.Entity
17:39:35,558 DEBUG net.sf.hibernate.hql.QueryTranslator:200 - SQL: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:35,558 DEBUG net.sf.hibernate.impl.BatcherImpl:192 - about to open: 0 open PreparedStatements, 0 open ResultSets
17:39:35,558 DEBUG net.sf.hibernate.SQL:223 - select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
Hibernate: select entity0_.publication_id as publicat1_, entity0_.name as name from publication entity0_
17:39:35,558 DEBUG net.sf.hibernate.impl.BatcherImpl:227 - preparing statement
17:39:35,568 DEBUG net.sf.hibernate.loader.Loader:196 - processing result set
17:39:35,568 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '2' as column: publicat1_
17:39:35,568 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 2
17:39:35,568 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 2
17:39:35,568 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#2
17:39:35,568 DEBUG net.sf.hibernate.type.StringType:68 - returning 'TEST' as column: name
17:39:35,578 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '19' as column: publicat1_
17:39:35,578 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 19
17:39:35,578 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 19
17:39:35,578 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#19
17:39:35,578 DEBUG net.sf.hibernate.type.StringType:68 - returning '34 Applet Demo' as column: name
17:39:35,588 DEBUG net.sf.hibernate.type.IntegerType:68 - returning '46' as column: publicat1_
17:39:35,588 DEBUG net.sf.hibernate.loader.Loader:404 - result row: 46
17:39:35,588 DEBUG net.sf.hibernate.loader.Loader:535 - Initializing object from ResultSet: 46
17:39:35,588 DEBUG net.sf.hibernate.loader.Loader:604 - Hydrating entity: test.Entity#46
17:39:35,588 DEBUG net.sf.hibernate.type.StringType:68 - returning 'Shafieks publication' as column: name
17:39:35,588 DEBUG net.sf.hibernate.loader.Loader:225 - done processing result set (3 rows)
17:39:35,588 DEBUG net.sf.hibernate.impl.BatcherImpl:199 - done closing: 0 open PreparedStatements, 0 open ResultSets
17:39:35,668 DEBUG net.sf.hibernate.impl.BatcherImpl:240 - closing statement
17:39:35,668 DEBUG net.sf.hibernate.loader.Loader:238 - total objects hydrated: 3
17:39:35,668 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#2]
17:39:35,668 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#2]
17:39:35,668 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 2
17:39:35,668 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#2]
17:39:35,678 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#19]
17:39:35,678 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#19]
17:39:35,678 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 19
17:39:35,678 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#19]
17:39:35,678 DEBUG net.sf.hibernate.impl.SessionImpl:2129 - resolving associations for [test.Entity#46]
17:39:35,678 DEBUG net.sf.hibernate.impl.SessionImpl:2140 - adding entity to second-level cache [test.Entity#46]
17:39:35,688 DEBUG net.sf.hibernate.cache.ReadOnlyCache:37 - Caching: 46
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:2153 - done materializing entity [test.Entity#46]
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:3000 - initializing non-lazy collections
...
17:39:35,688 DEBUG net.sf.hibernate.transaction.JDBCTransaction:59 - commit
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:2193 - flushing session
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:2321 - Flushing entities and processing referenced collections
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:2664 - Processing unreferenced collections
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:2678 - Scheduling collection removes/(re)creates/updates
17:39:35,688 DEBUG net.sf.hibernate.impl.SessionImpl:2217 - Flushed: 0 insertions, 0 updates, 0 deletions to 3 objects
17:39:35,699 DEBUG net.sf.hibernate.impl.SessionImpl:2222 - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
17:39:35,699 DEBUG net.sf.hibernate.impl.Printer:75 - listing entities:
17:39:35,699 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=34 Applet Demo, id=19}
17:39:35,699 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=TEST, id=2}
17:39:35,699 DEBUG net.sf.hibernate.impl.Printer:82 - test.Entity{name=Shafieks publication, id=46}
17:39:35,699 DEBUG net.sf.hibernate.impl.SessionImpl:2258 - executing flush
17:39:35,699 DEBUG net.sf.hibernate.impl.SessionImpl:2708 - post flush
17:39:35,709 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
17:39:35,709 DEBUG net.sf.hibernate.impl.SessionImpl:546 - closing session
17:39:35,709 DEBUG net.sf.hibernate.impl.SessionImpl:3187 - disconnecting session
17:39:35,709 DEBUG net.sf.hibernate.connection.DriverManagerConnectionProvider:114 - returning connection to pool, pool size: 1
17:39:35,709 DEBUG net.sf.hibernate.impl.SessionImpl:558 - transaction completion
From the log, it appears as if the SQL is being executed each time. Is the second level cache being used? Am I missing something?