Have two entities with a one to many relationship from trial to crf, but am only trying to insert trials at this point. My code is simple, but stops at DIFFERENT points each time I run it. No errors are thrown, and I use a separate browser to verify that the schema is correct and the data are inserted, up to where it stops. When I trace it with the debugger, it gets to various points and then acts like it is finished. The console output is excerpted below (I can post much more detail if necessary):
08:05:41,584 INFO Environment:460 - Hibernate 3.0
08:05:41,592 INFO Environment:473 - hibernate.properties not found
08:05:41,598 INFO Environment:506 - using CGLIB reflection optimizer
08:05:41,604 INFO Environment:536 - using JDK 1.4 java.sql.Timestamp handling
08:05:41,606 INFO Configuration:1239 - configuring from resource: /hibernate.cfg.xml
08:05:41,607 INFO Configuration:1210 - Configuration resource: /hibernate.cfg.xml
08:05:41,815 INFO Configuration:439 - Mapping resource: Trial.hbm.xml
08:05:42,019 INFO HbmBinder:258 - Mapping class: mike.dean.Trial -> TRIAL
08:05:42,071 INFO Configuration:439 - Mapping resource: Crf.hbm.xml
08:05:42,112 INFO HbmBinder:258 - Mapping class: mike.dean.Crf -> CRF
08:05:42,216 INFO Configuration:1351 - Configured SessionFactory: sessionFactory
08:05:42,219 INFO Configuration:850 - processing extends queue
08:05:42,220 INFO Configuration:854 - processing collection mappings
08:05:42,221 INFO HbmBinder:1953 - Mapping collection: mike.dean.Trial.crfs -> CRF
08:05:42,222 INFO Configuration:863 - processing association property references
08:05:42,234 INFO Configuration:892 - processing foreign key constraints
08:05:42,275 INFO Dialect:91 - Using dialect: org.hibernate.dialect.HSQLDialect
08:05:42,291 INFO SettingsFactory:90 - Default batch fetch size: 1
08:05:42,292 INFO SettingsFactory:94 - Generate SQL with comments: disabled
08:05:42,298 INFO SettingsFactory:98 - Order SQL updates by primary key: disabled
08:05:42,299 INFO SettingsFactory:273 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
08:05:42,307 INFO ASTQueryTranslatorFactory:21 - Using ASTQueryTranslatorFactory
08:05:42,308 INFO SettingsFactory:106 - Query language substitutions: {}
08:05:42,319 INFO C3P0ConnectionProvider:50 - C3P0 using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost
08:05:42,320 INFO C3P0ConnectionProvider:51 - Connection properties: {user=sa}
08:05:42,322 INFO C3P0ConnectionProvider:54 - autocommit mode: false
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@bdbf9d [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@c0cb76 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 3000, initialPoolSize -> 5, maxIdleTime -> 300, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@ea6a1c [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:hsqldb:hsql://localhost, properties -> {user=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> bdbf9d ]
08:05:42,882 INFO SettingsFactory:148 - JDBC batch size: 15
08:05:42,883 INFO SettingsFactory:151 - JDBC batch updates for versioned data: disabled
08:05:42,885 INFO SettingsFactory:156 - Scrollable result sets: enabled
08:05:42,887 INFO SettingsFactory:164 - JDBC3 getGeneratedKeys(): disabled
08:05:42,894 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
08:05:42,906 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
08:05:42,907 INFO SettingsFactory:176 - Automatic flush during beforeCompletion(): disabled
08:05:42,911 INFO SettingsFactory:179 - Automatic session close at end of transaction: disabled
08:05:42,911 INFO SettingsFactory:260 - Cache provider: org.hibernate.cache.EhCacheProvider
08:05:42,919 INFO SettingsFactory:187 - Second-level cache: enabled
08:05:42,920 INFO SettingsFactory:192 - Optimize cache for minimal puts: disabled
08:05:42,920 INFO SettingsFactory:199 - Structured second-level cache entries: enabled
08:05:42,921 INFO SettingsFactory:203 - Query cache: disabled
08:05:42,921 INFO SettingsFactory:210 - Echoing all SQL to stdout
08:05:42,922 INFO SettingsFactory:214 - Statistics: disabled
08:05:42,922 INFO SettingsFactory:218 - Deleted entity synthetic identifier rollback: disabled
08:05:42,925 INFO SettingsFactory:232 - Default entity-mode: pojo
08:05:43,151 INFO SessionFactoryImpl:140 - building session factory
08:05:43,167 WARN Configurator:126 - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/Applications/eclipse/plugins/org.hibernate.eclipse_3.0.0.alpha2/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
08:05:43,693 INFO SessionFactoryObjectFactory:86 - Factory name: sessionFactory
08:05:43,700 INFO NamingHelper:26 - JNDI InitialContext properties:{}
08:05:43,709 WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
at javax.naming.InitialContext.getNameParser(InitialContext.java:439)
at org.hibernate.util.NamingHelper.bind(NamingHelper.java:52)
at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:247)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1054)
at mike.dean.ManipulateTrialCrfTest.testWriteTrial(ManipulateTrialCrfTest.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
08:05:43,723 INFO Dialect:91 - Using dialect: org.hibernate.dialect.HSQLDialect
08:05:43,725 INFO Configuration:850 - processing extends queue
08:05:43,725 INFO Configuration:854 - processing collection mappings
08:05:43,726 INFO Configuration:863 - processing association property references
08:05:43,727 INFO Configuration:892 - processing foreign key constraints
08:05:43,733 INFO Configuration:850 - processing extends queue
08:05:43,733 INFO Configuration:854 - processing collection mappings
08:05:43,734 INFO Configuration:863 - processing association property references
08:05:43,734 INFO Configuration:892 - processing foreign key constraints
08:05:43,737 INFO SchemaExport:114 - Running hbm2ddl schema export
08:05:43,737 INFO SchemaExport:130 - exporting generated schema to database
08:05:43,738 INFO C3P0ConnectionProvider:50 - C3P0 using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost
08:05:43,739 INFO C3P0ConnectionProvider:51 - Connection properties: {user=sa}
08:05:43,740 INFO C3P0ConnectionProvider:54 - autocommit mode: false
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@a5f0f3 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@4005e1 [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 3000, initialPoolSize -> 5, maxIdleTime -> 300, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@25f9f [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:hsqldb:hsql://localhost, properties -> {user=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> a5f0f3 ]
08:05:43,865 DEBUG SchemaExport:144 - alter table CRF drop constraint FK105B766FF8EF1
08:05:43,867 DEBUG SchemaExport:144 - alter table CRF drop constraint FK105B710DE8552
08:05:43,869 DEBUG SchemaExport:144 - drop table CRF if exists
08:05:43,870 DEBUG SchemaExport:144 - drop table TRIAL if exists
08:05:43,872 DEBUG SchemaExport:162 - create table CRF (
crf_id bigint generated by default as identity (start with 1),
crf_name varchar(40),
crf_version varchar(5),
study_interval integer,
status varchar(20),
approve_date date,
trial_id bigint not null,
primary key (crf_id)
)
08:05:43,875 DEBUG SchemaExport:162 - create table TRIAL (
trial_id bigint generated by default as identity (start with 1),
dcc_number varchar(10),
short_title varchar(40),
long_title varchar(240),
investigator varchar(40),
approve_date date,
primary key (trial_id)
)
08:05:43,877 DEBUG SchemaExport:162 - alter table CRF add constraint FK105B766FF8EF1 foreign key (crf_id) references TRIAL
08:05:43,879 DEBUG SchemaExport:162 - alter table CRF add constraint FK105B710DE8552 foreign key (trial_id) references TRIAL
08:05:43,882 INFO SchemaExport:174 - schema export complete
08:05:43,914 INFO Dialect:91 - Using dialect: org.hibernate.dialect.HSQLDialect
08:05:43,916 INFO Configuration:850 - processing extends queue
08:05:43,917 INFO Configuration:854 - processing collection mappings
08:05:43,918 INFO Configuration:863 - processing association property references
08:05:43,918 INFO Configuration:892 - processing foreign key constraints
08:05:43,920 INFO Configuration:850 - processing extends queue
08:05:43,924 INFO Configuration:854 - processing collection mappings
08:05:43,925 INFO Configuration:863 - processing association property references
08:05:43,930 INFO Configuration:892 - processing foreign key constraints
08:05:43,936 INFO SessionFactoryImpl:366 - Checking 0 named queries
Hibernate: insert into TRIAL (dcc_number, short_title, long_title, investigator, approve_date, trial_id) values (?, ?, ?, ?, ?, null)
Hibernate: call identity()
Hibernate: insert into TRIAL (dcc_number, short_title, long_title, investigator, approve_date, trial_id) values (?, ?, ?, ?, ?, null)
_________________ J. Michael Dean, MD
|