There are some problems with using Hibernate to connect pool with Proxool today. The problem is that when you do not manipulate the database through the Web, you are prompted unable to open JDBC connection for schema management target For example, when using JUnit or the main method to perform a database operation, the following error occurs Exception in thread "main" org.hibernate.tool.schema.spi.SchemaManagementException:Unable to open JDBC connection for schema management target at O Rg.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare (targetdatabaseimpl.java:42) at Org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration (schemamigratorimpl.java:57) at Org.hibernate.tool.hbm2ddl.SchemaUpdate.execute (schemaupdate.java:134) at Org.hibernate.tool.hbm2ddl.SchemaUpdate.execute (schemaupdate.java:101) at Org.hibernate.internal.sessionfactoryimpl.<init> (sessionfactoryimpl.java:472) at Org.hibernate.boot.internal.SessionFactoryBuilderImpl.build (sessionfactorybuilderimpl.java:444) at Org.hibernate.boot.internal.MetadataImpl.buildSessionFactory (metadataimpl.java:170) at Com.express.util.HibernateUtil.getSessionFactory (hibernateutil.java:31) at com.express. util.
Hibernateutil.opensession (hibernateutil.java:47) at Insertorder.main (insertorder.java:13)
caused by:java.sql.SQLException:No suitable driver found for Proxool.proxool
At Java.sql.DriverManager.getConnection (drivermanager.java:689)
At Java.sql.DriverManager.getConnection (drivermanager.java:270)
At Org.hibernate.proxool.internal.ProxoolConnectionProvider.getConnection (proxoolconnectionprovider.java:69)
At org.hibernate.engine.jdbc.env.internal.jdbcenvironmentinitiator$ Connectionproviderjdbcconnectionaccess.obtainconnection (jdbcenvironmentinitiator.java:180)
At Org.hibernate.tool.schema.internal.TargetDatabaseImpl.prepare (targetdatabaseimpl.java:38)
... 9 more
After several modifications and tests, the result is found in the setup
The value of Hibernate.proxool.existing_pool has some conflicts, this value is set to False, when Hibernate starts to be called, it initializes the Proxool, makes the database connection and so on.
When set to true, the existing proxool is used. When using JUnit or the main method to perform database operations, because these operations are not servletconfigurator listening, so there is no initialization of proxool, resulting in no database connection operation, so that the program error.
The above for personal understanding, if there are errors, can comment on the Exchange
2016.10.15
deployed the project to Linux today and found that the database connection still had this error, and when I set the Hibernate.proxool.existing_pool to False, the problem was resolved, and the reason was not known, For now,
Ps:windos setting Hibernate.proxool.existing_pool to True
Linux setting Hibernate.proxool.existing_pool to False