These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate Table Creation
PostPosted: Wed Apr 25, 2007 10:11 am 
Newbie

Joined: Thu Feb 08, 2007 1:28 pm
Posts: 9
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3


I was wondering is there a setting for hibernate to generate the tables in the database you set? It seems like it should be able to get a basic table structure from the mapping files. I was just wondering because we're switching databases in the near future, and this would help tremendously.

There are some settings in the hibernate documentation that look like they might do what I'm looking for, but I'm not sure.

The properties that come to mind are:
hibernate.default_schema
hibernate.default_catalog
hibernate.hbm2ddl.auto

If anyone could help it'd be greatly appreciated. If you need any more information just ask.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 10:55 am 
Newbie

Joined: Thu Apr 19, 2007 1:46 am
Posts: 10
Hi,

This is the code for it.
Configuration config = new Configuration().configure();
SchemaExport sch = new SchemaExport(config);
sch.create(true, true);
SessionFactory sessionFactory = config.buildSessionFactory();

It drops and creates new tables everytime you run it.
sch.create(true, true);
This setting shows you the generated SQL
as well as DDL is immediately executed in the datadase
Though you can change the settings as you like.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 11:26 am 
Newbie

Joined: Thu Feb 08, 2007 1:28 pm
Posts: 9
I want it to create the table if it doesn't exist, and for it to stay in the database until I manually remove it.

I was also hoping for something I could put in the hibernate settings file. I'll look into this though.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 2:43 pm 
Newbie

Joined: Thu Feb 08, 2007 1:28 pm
Posts: 9
I added this to my hibernate.cfg.xml file

<property name="hibernate.hbm2ddl.auto">update</property>

Here is the entire mapping file:

Code:
<?xml version='1.0' encoding='utf-8'?>
<!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="connection.url">jdbc:mysql://localhost/EMST</property>
      <property name="connection.username">root</property>
      <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      <property name="connection.password"> * </property>
      
      <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
      
      <!-- Create Tables -->
      <property name="hibernate.hbm2ddl.auto">update</property>
      
      <!-- JDBC connection pool (use the built-in) -->
      <property name="connection.pool_size">5</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>
      
      <!-- Logging -->
       <property name="hibernate.show_sql">false</property>
      <!-- Note, Hibernate log level is set in log4j.properties -->
      
      <!-- Show and print nice SQL on stdout  -->
      <property name="show_sql">true</property>
      <property name="format_sql">true</property>
      <property name="use_sql_comment">true</property>
      
      <mapping resource="emst/dao/state/State.hbm.xml" />
      <mapping resource="emst/dao/person/Person.hbm.xml" />
      <mapping resource="emst/dao/user/User.hbm.xml" />
      <mapping resource="emst/dao/player/Player.hbm.xml" />
      <mapping resource="emst/dao/player/Role.hbm.xml" />
      <mapping resource="emst/dao/player/RoleList.hbm.xml" />
      <mapping resource="emst/dao/exercise/Exercise.hbm.xml" />
      <mapping resource="emst/dao/exercise/Location.hbm.xml" />
      <mapping resource="emst/dao/uibutton/Button.hbm.xml" />
      <mapping resource="emst/dao/uibutton/ButtonRelationship.hbm.xml" />
      <mapping resource="emst/dao/form/Form.hbm.xml" />
      <mapping resource="emst/dao/form/FormRelationship.hbm.xml" />
      <mapping resource="emst/dao/email/Attachment.hbm.xml" />
      <mapping resource="emst/dao/email/Email.hbm.xml" />
      <mapping resource="emst/dao/email/EmailData.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/Resource.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/Link.hbm.xml" />
      <mapping resource="emst/dao/entity/EntityDefinition.hbm.xml" />
      <mapping resource="emst/dao/entity/EntityType.hbm.xml" />
      <mapping resource="emst/dao/entity/UnitDefinition.hbm.xml" />
      <mapping resource="emst/dao/command/Command.hbm.xml" />
      <mapping resource="emst/dao/assessment/Task.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/course/Course.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/lesson/Lesson.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/kobject/KObject.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/kobject/KObjectProgress.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/course/progress/ProgressView.hbm.xml" />
      <mapping resource="emst/dao/assessment/ScenarioAssessment.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/test/Answer.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/test/Question.hbm.xml" />
      <mapping resource="emst/dao/ktrainer/test/QuestionType.hbm.xml" />
      <mapping resource="emst/dao/sa/SAQuestions.hbm.xml" />

   </session-factory>
</hibernate-configuration>


As I understand it, that's supposed to update or create, but it won't drop or clear the table.

When i added that i started getting this:
DEBUG: [25.04.07 14:40:02 PM] com.mchange.v2.resourcepool.BasicResourcePool - An exception occurred while acquiring a resource.
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)
at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:81)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:96)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:89)
at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:665)
at com.mchange.v2.resourcepool.BasicResourcePool.access$500(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1204)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)

Does anyone know what could be causing this?


Last edited by jlafata on Wed Apr 25, 2007 2:52 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 2:51 pm 
Newbie

Joined: Thu Feb 08, 2007 1:28 pm
Posts: 9
Here is the log right above the error, I hope this can be used to help solve the problem.

Code:
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
DEBUG: [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Connection release mode: auto
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO : [25.04.07 14:39:14 PM] org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Query language substitutions: {no='N', yes='Y'}
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Query cache: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Statistics: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - table found: EMST.entitynimscategories
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - columns: [sort, category, entitydefid]
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: [fkd4072c60f889187d]
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [primary, fkd4072c60f889187d]
INFO : [25.04.07 14:39:14 PM] org.hibernate.connection.C3P0ConnectionProvider - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/EMST
INFO : [25.04.07 14:39:14 PM] org.hibernate.connection.C3P0ConnectionProvider - Connection properties: {user=root, password=****}
INFO : [25.04.07 14:39:14 PM] org.hibernate.connection.C3P0ConnectionProvider - autocommit mode: false
INFO : [25.04.07 14:39:14 PM] com.mchange.v2.c3p0.PoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@82d210 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@4ab2f [ acquireIncrement -> 2, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 4ab2f, idleConnectionTestPeriod -> 3000, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@c26b16 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> c26b16, jdbcUrl -> jdbc:mysql://localhost/EMST, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 82d210, numHelperThreads -> 3 ]
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - awaitAvailable(): [unknown]
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 0, unused: 0, excluded: 0]
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 1, unused: 1, excluded: 0]
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - resource age is okay: com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4 ---> age: 16   max: 1800000 [com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6]
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 1, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4)
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.0.27-community-nt
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 2, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4)
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.c3p0.stmt.GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 0; checked out: 0; num connections: 0; num keys: 0
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4)
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4)
INFO : [25.04.07 14:39:14 PM] org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
INFO : [25.04.07 14:39:14 PM] org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
INFO : [25.04.07 14:39:14 PM] org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 4, unused: 4, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4)
DEBUG: [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Connection release mode: auto
DEBUG: [25.04.07 14:39:14 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@1f1cbf6 [managed: 5, unused: 5, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@11a4bd4)
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO : [25.04.07 14:39:14 PM] org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Query language substitutions: {no='N', yes='Y'}
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Query cache: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Statistics: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
INFO : [25.04.07 14:39:14 PM] org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - table found: EMST.entitysupplyparams
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - columns: [sort, supplyvalue, entitydefid]
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: [fk74e516f8f889187d]
INFO : [25.04.07 14:39:14 PM] org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [primary, fk74e516f8f889187d]
INFO : [25.04.07 14:39:14 PM] org.hibernate.connection.C3P0ConnectionProvider - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/EMST
INFO : [25.04.07 14:39:14 PM] org.hibernate.connection.C3P0ConnectionProvider - Connection properties: {user=root, password=****}
INFO : [25.04.07 14:39:14 PM] org.hibernate.connection.C3P0ConnectionProvider - autocommit mode: false
INFO : [25.04.07 14:39:15 PM] com.mchange.v2.c3p0.PoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@196e136 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@1397e5c [ acquireIncrement -> 2, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1397e5c, idleConnectionTestPeriod -> 3000, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@1198ff2 [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1198ff2, jdbcUrl -> jdbc:mysql://localhost/EMST, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 196e136, numHelperThreads -> 3 ]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - awaitAvailable(): [unknown]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 0, unused: 0, excluded: 0]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 1, unused: 1, excluded: 0]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - resource age is okay: com.mchange.v2.c3p0.impl.NewPooledConnection@179d854 ---> age: 0   max: 1800000 [com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 1, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@179d854)
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.0.27-community-nt
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 2, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@179d854)
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.c3p0.stmt.GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 0; checked out: 0; num connections: 0; num keys: 0
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@179d854)
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@179d854)
INFO : [25.04.07 14:39:15 PM] org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
INFO : [25.04.07 14:39:15 PM] org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
INFO : [25.04.07 14:39:15 PM] org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 4, unused: 4, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@179d854)
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@3a0ab1 [managed: 5, unused: 5, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@179d854)
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
DEBUG: [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Wrap result sets: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Connection release mode: auto
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO : [25.04.07 14:39:15 PM] org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Query language substitutions: {no='N', yes='Y'}
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Query cache: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Cache provider: org.hibernate.cache.NoCacheProvider
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Statistics: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
INFO : [25.04.07 14:39:15 PM] org.hibernate.tool.hbm2ddl.TableMetadata - table found: EMST.entitytype
INFO : [25.04.07 14:39:15 PM] org.hibernate.tool.hbm2ddl.TableMetadata - columns: [entitytypename, entitytypeid]
INFO : [25.04.07 14:39:15 PM] org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: []
INFO : [25.04.07 14:39:15 PM] org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [primary]
INFO : [25.04.07 14:39:15 PM] org.hibernate.connection.C3P0ConnectionProvider - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/EMST
INFO : [25.04.07 14:39:15 PM] org.hibernate.connection.C3P0ConnectionProvider - Connection properties: {user=root, password=****}
INFO : [25.04.07 14:39:15 PM] org.hibernate.connection.C3P0ConnectionProvider - autocommit mode: false
INFO : [25.04.07 14:39:15 PM] com.mchange.v2.c3p0.PoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@16504fa [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@18efaea [ acquireIncrement -> 2, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 18efaea, idleConnectionTestPeriod -> 3000, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@19518cc [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 19518cc, jdbcUrl -> jdbc:mysql://localhost/EMST, properties -> {user=******, password=******} ], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ], factoryClassLocation -> null, identityToken -> 16504fa, numHelperThreads -> 3 ]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - awaitAvailable(): [unknown]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@fd66a5 [managed: 0, unused: 0, excluded: 0]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@fd66a5 [managed: 1, unused: 1, excluded: 0]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - resource age is okay: com.mchange.v2.c3p0.impl.NewPooledConnection@3228a1 ---> age: 0   max: 1800000 [com.mchange.v2.resourcepool.BasicResourcePool@fd66a5]
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@fd66a5 [managed: 1, unused: 0, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3228a1)
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.0.27-community-nt
INFO : [25.04.07 14:39:15 PM] org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@fd66a5 [managed: 2, unused: 1, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3228a1)
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@fd66a5 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@3228a1)
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.c3p0.stmt.GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 0; checked out: 0; num connections: 0; num keys: 0
DEBUG: [25.04.07 14:39:15 PM] com.mchange.v2.resourcepool.BasicResourcePool - An exception occurred while acquiring a resource.
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Data source rejected establishment of connection,  message from server: "Too many connections"
   at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:921)
   at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:997)
   at com.mysql.jdbc.Connection.createNewIO(Connection.java:2670)
   at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
   at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
   at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:81)
   at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:96)
   at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3P0PooledConnectionPool.java:89)
   at com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResourcePool.java:665)
   at com.mchange.v2.resourcepool.BasicResourcePool.access$500(BasicResourcePool.java:32)
   at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1204)
   at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:368)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 25, 2007 3:52 pm 
Newbie

Joined: Thu Feb 08, 2007 1:28 pm
Posts: 9
This problem has been temporarily solved.

When i turn off c3p0 as the thread pool it worked.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.