bapsred wrote:
Hibernate version:2.1
Mapping documents:hibernate.properties file
## PostgreSQL
hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc:postgresql://localhost/testdb
hibernate.connection.username=postgres
hibernate.connection.password=postgres
hibernate.connection.provider_class = net.sf.hibernate.connection.C3P0ConnectionProvider
hibernate.c3p0.acquire_increment=1
hibernate.c3p0.idle_test_period=100
hibernate.c3p0.min_size=2
hibernate.c3p0.max_size=10
hibernate.c3p0.timeout=1800
hibernate.c3p0.max_statement=50
hibernate.c3p0.validate=false
hibernate.c3p0.idle_test_period=1800
hibernate.query.substitutions yes 'Y', no 'N'
#################################
### Hibernate Connection Pool ###
#################################
hibernate.connection.pool_size 100
Code between sessionFactory.openSession() and session.close():
public static Session getSession() throws Exception
{
Session pcsSession = (Session) localThread.get();
if (pcsSession == null)
{
if (sessionFactory == null)
{
init();
}
pcsSession = sessionFactory.openSession();
localThread.set(pcsSession);
}
return pcsSession;
}
// The init method
private static synchronized void init() throws Exception
{
if (sessionFactory != null)
{
/**
* Perfrom this to check if more than one user might be
* trying this at same time.
*/
return;
}
Configuration cfg = null;
try
{
cfg = new Configuration();
cfg.addClass(com.test.Test.class);
sessionFactory = cfg.buildSessionFactory();
logger.info("HibernateSession Initialized SessionFactory:" + sessionFactory);
}
catch (Exception pEx)
{
logger.error("Could not intialize Hibernate Session Factory: "+ pEx.getMessage());
throw new Exception("Could not intialize Hibernate session factory: "+ pEx.getMessage());
}
}
Full stack trace of any exception that occurs:
2004-11-08 17:20:55,531 [PoolThread-9] INFO - processing one-to-one association property references
2004-11-08 17:20:55,531 [PoolThread-9] INFO - processing foreign key constraints
2004-11-08 17:20:55,562 [PoolThread-9] INFO - Using dialect: net.sf.hibernate.dialect.PostgreSQLDialect
2004-11-08 17:20:55,562 [PoolThread-9] INFO - Maximim outer join fetch depth: 1
2004-11-08 17:20:55,562 [PoolThread-9] INFO - Use outer join fetching: true
2004-11-08 17:20:55,562 [PoolThread-9] INFO - Initializing connection provider: net.sf.hibernate.connection.C3P0ConnectionProvider
2004-11-08 17:20:55,578 [PoolThread-9] INFO - C3P0 using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost/testdb
2004-11-08 17:20:55,578 [PoolThread-9] INFO - Connection properties: {user=postgres, password=postgres}
2004-11-08 17:20:55,640 [PoolThread-9] INFO - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
2004-11-08 17:20:55,718 [PoolThread-9] ERROR - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@185e155 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@16b152b [ 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 -> 1800, initialPoolSize -> 2, maxIdleTime -> 1800, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 2, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1bd427 [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:postgresql://localhost/testdb, properties -> {user=******, password=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> 185e155 ]
2004-11-08 17:20:55,921 [PoolThread-9] ERROR - Rolling back potentially unresolved txn...
Name and version of the database you are using: PostgreSQL 7.4
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: