Joined: Tue Apr 07, 2009 10:47 am Posts: 4
|
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.4.0
Mapping documents: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration> <session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property> <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> <property name="hibernate.connection.url">jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1522:pprd01</property> <property name="hibernate.connection.username">name</property> <property name="hibernate.connection.password">passwd</property>
<!-- JDBC connection pool (use the built-in) --> <property name="connection.pool_size">1</property> <!-- Important! addendum to what is in text --> <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<!-- Enable Hibernate's automatic session context management --> <property name="current_session_context_class">thread</property>
<!-- Disable the second-level cache --> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout - You can disable this once you have it working --> <property name="show_sql">true</property> <mapping class="oc4j.hibernate.Security"/> </session-factory> </hibernate-configuration>
Code between sessionFactory.openSession() and session.close(): public class testSecurity { final static Logger logger = LoggerFactory.getLogger(testSecurity.class); /** * @param args */ public static void main(String[] args) {
Security newSec1 = new Security(); newSec1.setCusip("12345"); newSec1.setName("new security1"); newSec1.setInt_rate("5.75"); Security newSec2 = new Security(); newSec2.setCusip("67890"); newSec2.setName("new security2"); newSec2.setInt_rate("4.25");
//createSecurity(newSec1); //createSecurity(newSec2);
// our instances have a primary key now: logger.debug("{}", newSec1); logger.debug("{}", newSec2); listSecurity(); //deleteSecurity(newSec1); listSecurity(); newSec2.setName("new sec2 name"); updateSecurity(newSec2); } private static void listSecurity() { Transaction tx = null; Session session = SessionFactoryUtil.getInstance().getCurrentSession(); try { tx = session.beginTransaction(); List securities = session.createQuery("select security_cusip from invest_p_security") .list(); for (Iterator iter = securities.iterator(); iter.hasNext();) { Security element = (Security) iter.next(); logger.debug("{}", element); } tx.commit(); } catch (RuntimeException e) { if (tx != null && tx.isActive()) { try { // Second try catch as the rollback could fail as well tx.rollback(); } catch (HibernateException e1) { logger.debug("Error rolling back transaction"); } // throw again the first exception throw e; } } } private static void deleteSecurity(Security security) { Transaction tx = null; Session session = SessionFactoryUtil.getInstance().getCurrentSession(); try { tx = session.beginTransaction(); session.delete(security); tx.commit(); } catch (RuntimeException e) { if (tx != null && tx.isActive()) { try { // Second try catch as the rollback could fail as well tx.rollback(); } catch (HibernateException e1) { logger.debug("Error rolling back transaction"); } // throw again the first exception throw e; } } } private static void createSecurity(Security security) { Transaction tx = null; Session session = SessionFactoryUtil.getInstance().getCurrentSession(); try { tx = session.beginTransaction(); session.save(security); tx.commit(); } catch (RuntimeException e) { if (tx != null && tx.isActive()) { try { // Second try catch as the rollback could fail as well tx.rollback(); } catch (HibernateException e1) { logger.debug("Error rolling back transaction"); } // throw again the first exception throw e; } } } private static void updateSecurity(Security security) { Transaction tx = null; Session session = SessionFactoryUtil.getInstance().getCurrentSession(); try { tx = session.beginTransaction(); session.update(security); tx.commit(); } catch (RuntimeException e) { if (tx != null && tx.isActive()) { try { // Second try catch as the rollback could fail as well tx.rollback(); } catch (HibernateException e1) { logger.debug("Error rolling back transaction"); } // throw again the first exception throw e; } } } }
Full stack trace of any exception that occurs: 08:18:04,750 DEBUG testSecurity:37 -08:18:04,750 DEBUG testSecurity:38 -08:18:04,765 INFO Version:15 -08:18:04,765 INFO Environment:543 -08:18:04,781 INFO Environment:576 -08:18:04,781 INFO Environment:709 -08:18:04,781 INFO Environment:627 -08:18:04,828 INFO Version:14 -08:18:04,828 INFO Configuration:1460 -08:18:04,828 INFO Configuration:1437 -08:18:04,875 DEBUG DTDEntityResolver:64 -08:18:04,875 DEBUG DTDEntityResolver:66 -08:18:04,875 DEBUG DTDEntityResolver:76 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG Configuration:1421 -08:18:04,890 DEBUG AnnotationConfiguration:644 -08:18:04,906 INFO Configuration:1575 -08:18:04,906 DEBUG Configuration:1576 -08:18:04,906 DEBUG AnnotationConfiguration:806 -08:18:04,906 DEBUG HibernateSearchEventListenerRegister:209 -08:18:04,906 INFO HibernateSearchEventListenerRegister:53 -08:18:04,906 DEBUG Configuration:1318 -08:18:04,906 DEBUG AnnotationConfiguration:258 -08:18:04,953 DEBUG AnnotationConfiguration:529 -08:18:04,953 DEBUG AnnotationConfiguration:537 -08:18:04,953 INFO AnnotationBinder:419 -08:18:04,968 DEBUG Ejb3Column:161 -08:18:04,984 DEBUG EntityBinder:295 -08:18:04,984 INFO EntityBinder:422 -08:18:04,984 DEBUG AnnotationBinder:1022 -08:18:05,000 DEBUG AnnotationBinder:1022 -08:18:05,000 DEBUG AnnotationBinder:1133 -08:18:05,000 DEBUG Ejb3Column:161 -08:18:05,000 DEBUG AnnotationBinder:1257 -08:18:05,015 DEBUG SimpleValueBinder:220 -08:18:05,015 DEBUG PropertyBinder:131 -08:18:05,015 DEBUG AnnotationBinder:1293 -08:18:05,015 DEBUG AnnotationBinder:1133 -08:18:05,015 DEBUG Ejb3Column:161 -08:18:05,015 DEBUG PropertyBinder:110 -08:18:05,015 DEBUG SimpleValueBinder:220 -08:18:05,015 DEBUG PropertyBinder:131 -08:18:05,015 DEBUG AnnotationBinder:1133 -08:18:05,015 DEBUG Ejb3Column:161 -08:18:05,015 DEBUG PropertyBinder:110 -08:18:05,015 DEBUG SimpleValueBinder:220 -08:18:05,015 DEBUG PropertyBinder:131 -08:18:05,015 DEBUG AnnotationConfiguration:401 -08:18:05,015 DEBUG Configuration:1153 -08:18:05,015 DEBUG Configuration:1157 -08:18:05,015 DEBUG Configuration:1168 -08:18:05,015 DEBUG Configuration:1176 -08:18:05,015 DEBUG Configuration:1198 -08:18:05,015 INFO AnnotationConfiguration:369 -08:18:05,062 INFO DriverManagerConnectionProvider:64 -08:18:05,062 INFO DriverManagerConnectionProvider:65 -08:18:05,062 INFO DriverManagerConnectionProvider:68 -08:18:05,062 INFO DriverManagerConnectionProvider:103 -08:18:05,062 INFO DriverManagerConnectionProvider:106 -08:18:05,078 DEBUG DriverManagerConnectionProvider:132 -08:18:05,265 DEBUG DriverManagerConnectionProvider:138 -08:18:05,281 INFO SettingsFactory:116 -08:18:05,281 INFO SettingsFactory:117 -08:18:05,281 INFO Dialect:175 -08:18:05,296 INFO TransactionFactoryFactory:59 -08:18:05,296 INFO TransactionManagerLookupFactory:80 -08:18:05,296 INFO SettingsFactory:170 -08:18:05,296 INFO SettingsFactory:174 -08:18:05,296 INFO SettingsFactory:181 -08:18:05,296 INFO SettingsFactory:184 -08:18:05,296 INFO SettingsFactory:189 -08:18:05,296 DEBUG SettingsFactory:193 -08:18:05,296 INFO SettingsFactory:197 -08:18:05,296 INFO SettingsFactory:205 -08:18:05,296 INFO SettingsFactory:232 -08:18:05,296 INFO SettingsFactory:236 -08:18:05,296 INFO SettingsFactory:240 -08:18:05,296 INFO SettingsFactory:244 -08:18:05,296 INFO SettingsFactory:420 -08:18:05,296 INFO SettingsFactory:252 -08:18:05,296 INFO SettingsFactory:257 -08:18:05,296 INFO SettingsFactory:262 -08:18:05,296 INFO SettingsFactory:266 -08:18:05,296 INFO SettingsFactory:405 -08:18:05,296 INFO RegionFactoryCacheProviderBridge:61 -08:18:05,296 INFO SettingsFactory:276 -08:18:05,296 INFO SettingsFactory:285 -08:18:05,312 INFO SettingsFactory:305 -08:18:05,312 INFO SettingsFactory:314 -08:18:05,312 INFO SettingsFactory:318 -08:18:05,312 INFO SettingsFactory:333 -08:18:05,312 INFO SettingsFactory:337 -08:18:05,343 INFO SessionFactoryImpl:187 -08:18:05,343 DEBUG SessionFactoryImpl:205 -08:18:05,343 DEBUG SessionFactoryImpl:209 -08:18:05,453 DEBUG AbstractEntityPersister:2766 -08:18:05,453 DEBUG AbstractEntityPersister:2771 -08:18:05,453 DEBUG AbstractEntityPersister:2774 -08:18:05,453 DEBUG AbstractEntityPersister:2777 -08:18:05,453 DEBUG AbstractEntityPersister:2778 -08:18:05,453 DEBUG AbstractEntityPersister:2779 -08:18:05,468 DEBUG EntityLoader:102 -08:18:05,468 DEBUG EntityLoader:102 -08:18:05,468 DEBUG EntityLoader:102 -08:18:05,468 DEBUG EntityLoader:102 -08:18:05,468 DEBUG EntityLoader:102 -08:18:05,484 DEBUG EntityLoader:57 -08:18:05,484 DEBUG EntityLoader:57 -08:18:05,484 DEBUG SessionFactoryObjectFactory:62 -08:18:05,484 DEBUG SessionFactoryObjectFactory:99 -08:18:05,484 INFO SessionFactoryObjectFactory:105 -08:18:05,484 DEBUG SessionFactoryImpl:340 -08:18:05,484 DEBUG SessionFactoryImpl:426 -08:18:05,484 DEBUG SessionFactoryImpl:446 -08:18:05,515 DEBUG SessionImpl:247 -08:18:05,546 DEBUG JDBCTransaction:82 -08:18:05,546 DEBUG ConnectionManager:444 -08:18:05,546 DEBUG JDBCTransaction:87 -08:18:05,562 DEBUG JDBCTransaction:186 -Exception in thread "main" org.hibernate.QueryException: undefined alias: security_cusip [select security_cusip from invest_p_security] at org.hibernate.hql.classic.PathExpressionParser.token(PathExpressionParser.java:153) at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:51) at org.hibernate.hql.classic.SelectParser.token(SelectParser.java:199) at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:109) at org.hibernate.hql.classic.ClauseParser.end(ClauseParser.java:136) at org.hibernate.hql.classic.PreprocessingParser.end(PreprocessingParser.java:145) at org.hibernate.hql.classic.ParserHelper.parse(ParserHelper.java:52) at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:239) at org.hibernate.hql.classic.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:208) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:342) at $Proxy7.createQuery(Unknown Source) at oc4j.hibernate.testSecurity.listSecurity(testSecurity.java:53) at oc4j.hibernate.testSecurity.main(testSecurity.java:39) 08:18:05,562 DEBUG JDBCTransaction:197 -08:18:05,562 DEBUG ConnectionManager:427 -08:18:05,562 DEBUG ConnectionManager:464 -
Name and version of the database you are using: oracle 10.2.0.3
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: 2009-04-07 08:31:33,406 DEBUG oc4j.hibernate.testSecurity - Cusip: 12345 Name: new security1 Int Rate: 5.75 2009-04-07 08:31:33,406 DEBUG oc4j.hibernate.testSecurity - Cusip: 67890 Name: new security2 Int Rate: 4.25 2009-04-07 08:31:33,421 INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.GA 2009-04-07 08:31:33,421 INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA 2009-04-07 08:31:33,437 INFO org.hibernate.cfg.Environment - hibernate.properties not found 2009-04-07 08:31:33,437 INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist 2009-04-07 08:31:33,437 INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling 2009-04-07 08:31:33,484 INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.GA 2009-04-07 08:31:33,484 INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml 2009-04-07 08:31:33,484 INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml 2009-04-07 08:31:33,531 DEBUG org.hibernate.util.DTDEntityResolver - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] 2009-04-07 08:31:33,531 DEBUG org.hibernate.util.DTDEntityResolver - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/ 2009-04-07 08:31:33,531 DEBUG org.hibernate.util.DTDEntityResolver - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - hibernate.dialect=org.hibernate.dialect.Oracle10gDialect 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - hibernate.connection.url=jdbc:oracle:thin:@xxx:1522:pprd01 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - hibernate.connection.username=drenner 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - hibernate.connection.password=chairos10 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - connection.pool_size=1 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory 2009-04-07 08:31:33,546 DEBUG org.hibernate.cfg.Configuration - current_session_context_class=thread 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.Configuration - cache.provider_class=org.hibernate.cache.NoCacheProvider 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.Configuration - show_sql=true 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.AnnotationConfiguration - null <- org.dom4j.tree.DefaultAttribute@913fe2 [Attribute: name class value "oc4j.hibernate.Security"] 2009-04-07 08:31:33,562 INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.Configuration - properties: {hibernate.connection.password=chairos10, java.runtime.name=Java(TM) SE Runtime Environment, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, sun.boot.library.path=C:\Program Files\Java\jre6\bin, java.vm.version=11.3-b02, hibernate.connection.username=drenner, 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, user.country=US, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\eclipse\drenner\workspace\hibernate_example1, java.runtime.version=1.6.0_13-b03, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.current_session_context_class=thread, java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\drenner\LOCALS~1\Temp\, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., cache.provider_class=org.hibernate.cache.NoCacheProvider, user.variant=, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;C:\WINDOWS\system32\nls;C:\WINDOWS\system32\nls\ENGLISH;C:\Program Files\IDM Computer Solutions\UltraCompare\;C:\Program Files\IDM Computer Solutions\UltraEdit\;Z:., java.specification.name=Java Platform API Specification, java.class.version=50.0, hibernate.connection.pool_size=1, sun.management.compiler=HotSpot Client Compiler, hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory, os.version=5.1, user.home=C:\Documents and Settings\drenner, user.timezone=America/Los_Angeles, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.6, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, show_sql=true, user.name=drenner, java.class.path=C:\eclipse\drenner\workspace\hibernate_example1;C:\eclipse\drenner\workspace\hibernate_example1\bin;C:\ojdbc_driver\ojdbc14.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\c3p0\c3p0-0.9.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\ehcache\ehcache-1.2.3.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\oscache\oscache-2.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\proxool\proxool-0.8.3.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\swarmcache\swarmcache-1.0RC2.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\commons-collections-3.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\dom4j-1.6.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\javassist-3.4.GA.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\jta-1.1.jar;C:\hibernate-distribution-3.3.1.GA\hibernate-testing.jar;C:\hibernate-distribution-3.3.1.GA\hibernate3.jar;C:\hibernate-annotations-3.4.0.GA\hibernate-annotations.jar;C:\hibernate-entitymanager-3.4.0.GA\hibernate-entitymanager.jar;C:\hibernate-annotations-3.4.0.GA\lib\test\log4j.jar;C:\hibernate-annotations-3.4.0.GA\lib\ejb3-persistence.jar;C:\spring-framework-2.5.6\lib\cglib\cglib-nodep-2.1_3.jar;C:\hibernate-annotations-3.4.0.GA\lib\hibernate-commons-annotations.jar;C:\hibernate-annotations-3.4.0.GA\lib\test\slf4j-log4j12.jar;C:\hibernate-annotations-3.4.0.GA\lib\slf4j-api.jar;C:\hibernate-annotations-3.4.0.GA\lib\test\antlr.jar;C:\spring-framework-2.5.6\dist\spring.jar;C:\spring-framework-2.5.6\dist\spring-sources.jar;C:\eclipse\drenner\workspace\hibernate_example1\src, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, current_session_context_class=thread, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\jre6, sun.arch.data.model=32, hibernate.connection.url=jdbc:oracle:thin:@xxx:1522:sid, hibernate.dialect=org.hibernate.dialect.Oracle10gDialect, connection.pool_size=1, user.language=en, java.specification.vendor=Sun Microsystems Inc., awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, sharing, java.version=1.6.0_13, java.ext.dirs=C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, sun.boot.class.path=C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program Files\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\classes, 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, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86} 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.AnnotationConfiguration - Validator not present in classpath, ignoring event listener registration 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Search not present in classpath, ignoring event listener registration. 2009-04-07 08:31:33,562 INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled. 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {} 2009-04-07 08:31:33,562 DEBUG org.hibernate.cfg.AnnotationConfiguration - Execute first pass mapping processing 2009-04-07 08:31:33,609 DEBUG org.hibernate.cfg.AnnotationConfiguration - Process hbm files 2009-04-07 08:31:33,609 DEBUG org.hibernate.cfg.AnnotationConfiguration - Process annotated classes 2009-04-07 08:31:33,609 INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: oc4j.hibernate.Security 2009-04-07 08:31:33,625 DEBUG org.hibernate.cfg.Ejb3Column - Binding column DTYPE. Unique false. Nullable false. 2009-04-07 08:31:33,640 DEBUG org.hibernate.cfg.annotations.EntityBinder - Import with entity name Security 2009-04-07 08:31:33,640 INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity oc4j.hibernate.Security on table invest_p_security 2009-04-07 08:31:33,656 DEBUG org.hibernate.cfg.AnnotationBinder - Processing oc4j.hibernate.Security property annotation 2009-04-07 08:31:33,656 DEBUG org.hibernate.cfg.AnnotationBinder - Processing oc4j.hibernate.Security field annotation 2009-04-07 08:31:33,656 DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of oc4j.hibernate.Security.cusip 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.Ejb3Column - Binding column security_cusip. Unique false. Nullable true. 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.AnnotationBinder - cusip is an id 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for cusip 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property cusip 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.AnnotationBinder - Bind @Id on cusip 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of oc4j.hibernate.Security.int_rate 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.Ejb3Column - Binding column security_int_rate. Unique false. Nullable true. 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property int_rate with lazy=false 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for int_rate 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property int_rate 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.AnnotationBinder - Processing annotations of oc4j.hibernate.Security.name 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.Ejb3Column - Binding column security_name. Unique false. Nullable true. 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.PropertyBinder - binding property name with lazy=false 2009-04-07 08:31:33,671 DEBUG org.hibernate.cfg.annotations.SimpleValueBinder - building SimpleValue for name 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.annotations.PropertyBinder - Building property name 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.AnnotationConfiguration - processing fk mappings (*ToOne and JoinedSubclass) 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.Configuration - processing extends queue 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.Configuration - processing collection mappings 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.Configuration - processing association property references 2009-04-07 08:31:33,687 DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints 2009-04-07 08:31:33,687 INFO org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring 2009-04-07 08:31:33,718 INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!) 2009-04-07 08:31:33,718 INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1 2009-04-07 08:31:33,718 INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false 2009-04-07 08:31:33,734 INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbc:oracle:thin:@129.101.197.136:1522:pprd01 2009-04-07 08:31:33,734 INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=drenner, password=chairos10} 2009-04-07 08:31:33,734 DEBUG org.hibernate.connection.DriverManagerConnectionProvider - opening new JDBC connection 2009-04-07 08:31:33,937 DEBUG org.hibernate.connection.DriverManagerConnectionProvider - created connection to: jdbc:oracle:thin:@129.101.197.136:1522:pprd01, Isolation Level: 2 2009-04-07 08:31:33,937 INFO org.hibernate.cfg.SettingsFactory - RDBMS: Oracle, version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 2009-04-07 08:31:33,937 INFO org.hibernate.cfg.SettingsFactory - JDBC driver: Oracle JDBC driver, version: 10.2.0.3.0 2009-04-07 08:31:33,953 INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.Oracle10gDialect 2009-04-07 08:31:33,953 INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions) 2009-04-07 08:31:33,953 INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled 2009-04-07 08:31:33,953 DEBUG org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled 2009-04-07 08:31:33,953 INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.classic.ClassicQueryTranslatorFactory 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {} 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge 2009-04-07 08:31:33,968 INFO org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge - Cache provider: org.hibernate.cache.NoCacheProvider 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo 2009-04-07 08:31:33,968 INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled 2009-04-07 08:31:34,000 INFO org.hibernate.impl.SessionFactoryImpl - building session factory 2009-04-07 08:31:34,000 DEBUG org.hibernate.impl.SessionFactoryImpl - Session factory constructed with filter configurations : {} 2009-04-07 08:31:34,000 DEBUG org.hibernate.impl.SessionFactoryImpl - instantiating session factory with properties: {java.runtime.name=Java(TM) SE Runtime Environment, hibernate.connection.password=chairos10, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, sun.boot.library.path=C:\Program Files\Java\jre6\bin, java.vm.version=11.3-b02, hibernate.connection.username=drenner, 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, user.country=US, sun.java.launcher=SUN_STANDARD, sun.os.patch.level=Service Pack 3, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\eclipse\drenner\workspace\hibernate_example1, java.runtime.version=1.6.0_13-b03, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.current_session_context_class=thread, java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\drenner\LOCALS~1\Temp\, line.separator= , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, cache.provider_class=org.hibernate.cache.NoCacheProvider, os.name=Windows XP, sun.jnu.encoding=Cp1252, java.library.path=C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;C:\WINDOWS\system32\nls;C:\WINDOWS\system32\nls\ENGLISH;C:\Program Files\IDM Computer Solutions\UltraCompare\;C:\Program Files\IDM Computer Solutions\UltraEdit\;Z:., java.specification.name=Java Platform API Specification, java.class.version=50.0, hibernate.connection.pool_size=1, sun.management.compiler=HotSpot Client Compiler, hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory, os.version=5.1, user.home=C:\Documents and Settings\drenner, user.timezone=America/Los_Angeles, java.awt.printerjob=sun.awt.windows.WPrinterJob, java.specification.version=1.6, file.encoding=Cp1252, hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver, show_sql=true, java.class.path=C:\eclipse\drenner\workspace\hibernate_example1;C:\eclipse\drenner\workspace\hibernate_example1\bin;C:\ojdbc_driver\ojdbc14.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\c3p0\c3p0-0.9.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\ehcache\ehcache-1.2.3.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\oscache\oscache-2.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\proxool\proxool-0.8.3.jar;C:\hibernate-distribution-3.3.1.GA\lib\optional\swarmcache\swarmcache-1.0RC2.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\commons-collections-3.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\dom4j-1.6.1.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\javassist-3.4.GA.jar;C:\hibernate-distribution-3.3.1.GA\lib\required\jta-1.1.jar;C:\hibernate-distribution-3.3.1.GA\hibernate-testing.jar;C:\hibernate-distribution-3.3.1.GA\hibernate3.jar;C:\hibernate-annotations-3.4.0.GA\hibernate-annotations.jar;C:\hibernate-entitymanager-3.4.0.GA\hibernate-entitymanager.jar;C:\hibernate-annotations-3.4.0.GA\lib\test\log4j.jar;C:\hibernate-annotations-3.4.0.GA\lib\ejb3-persistence.jar;C:\spring-framework-2.5.6\lib\cglib\cglib-nodep-2.1_3.jar;C:\hibernate-annotations-3.4.0.GA\lib\hibernate-commons-annotations.jar;C:\hibernate-annotations-3.4.0.GA\lib\test\slf4j-log4j12.jar;C:\hibernate-annotations-3.4.0.GA\lib\slf4j-api.jar;C:\hibernate-annotations-3.4.0.GA\lib\test\antlr.jar;C:\spring-framework-2.5.6\dist\spring.jar;C:\spring-framework-2.5.6\dist\spring-sources.jar;C:\eclipse\drenner\workspace\hibernate_example1\src, user.name=drenner, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, current_session_context_class=thread, java.vm.specification.version=1.0, sun.arch.data.model=32, java.home=C:\Program Files\Java\jre6, hibernate.dialect=org.hibernate.dialect.Oracle10gDialect, hibernate.connection.url=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1522:sid, java.specification.vendor=Sun Microsystems Inc., user.language=en, connection.pool_size=1, awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, sharing, java.version=1.6.0_13, java.ext.dirs=C:\Program Files\Java\jre6\lib\ext;C:\WINDOWS\Sun\Java\lib\ext, sun.boot.class.path=C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Java\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program Files\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\classes, java.vendor=Sun Microsystems Inc., file.separator=\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.cpu.endian=little, sun.io.unicode.encoding=UnicodeLittle, sun.desktop=windows, sun.cpu.isalist=pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86} 2009-04-07 08:31:34,125 DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Static SQL for entity: oc4j.hibernate.Security 2009-04-07 08:31:34,125 DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Version select: select security_cusip from invest_p_security where security_cusip =? 2009-04-07 08:31:34,125 DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Snapshot select: select security_.security_cusip, security_.security_int_rate as security2_0_, security_.security_name as security3_0_ from invest_p_security security_ where security_.security_cusip=? 2009-04-07 08:31:34,125 DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Insert 0: insert into invest_p_security (security_int_rate, security_name, security_cusip) values (?, ?, ?) 2009-04-07 08:31:34,125 DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Update 0: update invest_p_security set security_int_rate=?, security_name=? where security_cusip=? 2009-04-07 08:31:34,125 DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Delete 0: delete from invest_p_security where security_cusip=? 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? for update 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? for update nowait 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? for update nowait 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_MERGE on entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? 2009-04-07 08:31:34,140 DEBUG org.hibernate.loader.entity.EntityLoader - Static select for action ACTION_REFRESH on entity oc4j.hibernate.Security: select security0_.security_cusip as security1_0_0_, security0_.security_int_rate as security2_0_0_, security0_.security_name as security3_0_0_ from invest_p_security security0_ where security0_.security_cusip=? 2009-04-07 08:31:34,156 DEBUG org.hibernate.impl.SessionFactoryObjectFactory - initializing class SessionFactoryObjectFactory 2009-04-07 08:31:34,156 DEBUG org.hibernate.impl.SessionFactoryObjectFactory - registered: 01e5c5a7208134ab01208134ac7c0000 (unnamed) 2009-04-07 08:31:34,156 INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured 2009-04-07 08:31:34,156 DEBUG org.hibernate.impl.SessionFactoryImpl - instantiated session factory 2009-04-07 08:31:34,156 DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named HQL queries 2009-04-07 08:31:34,156 DEBUG org.hibernate.impl.SessionFactoryImpl - Checking 0 named SQL queries 2009-04-07 08:31:34,171 DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 12391182941 2009-04-07 08:31:34,218 DEBUG org.hibernate.transaction.JDBCTransaction - begin 2009-04-07 08:31:34,218 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection 2009-04-07 08:31:34,218 DEBUG org.hibernate.transaction.JDBCTransaction - current autocommit status: false 2009-04-07 08:31:34,234 DEBUG org.hibernate.transaction.JDBCTransaction - rollback 2009-04-07 08:31:34,234 DEBUG org.hibernate.transaction.JDBCTransaction - rolled back JDBC Connection 2009-04-07 08:31:34,234 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection 2009-04-07 08:31:34,234 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
Problems with Session and transaction handling? not sure
Read this: http://hibernate.org/42.html
|
|