Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Hibernate JDBCExceptionReporter -> Connection validity, timeout, auto reconnect
- <hibernate-configuration>
- <session-factory>
- <!-- Database connection settings -->
- <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
- <property name="connection.url">jdbc:mysql://localhost/mydbtest</property>
- <property name="connection.username">root</property>
- <property name="connection.password">mypassword</property>
- <!-- JDBC connection pool (use the built-in) -->
- <property name="connection.pool_size">20</property>
- <!-- SQL dialect -->
- <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
- <!-- Enable Hibernate's automatic session context management, in this case
- the session will be close after each transaction! -->
- <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 -->
- <property name="show_sql">true</property>
- <!-- auto create tables -->
- <property name="hbm2ddl.auto">none</property>
- ...
- </session-factory>
- </hibernate-configuration>
- Hibernate: select ...
- WARN : org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 08S01
- ERROR: org.hibernate.util.JDBCExceptionReporter -
- The last packet successfully received from the server was 61.428.729
- milliseconds ago. The last packet sent successfully to the server was
- 61.428. milliseconds ago. is longer than the server configured value of
- 'wait_timeout'. You should consider either expiring and/or testing
- connection validity before use in your application, increasing the server
- configured values for client timeouts, or using the Connector/J
- connection property 'autoReconnect=true' to avoid this problem.
- <property name=“hibernate.c3p0.acquire_increment”>3</property>
- <property name=“hibernate.c3p0.idle_test_period”>14400</property>
- <property name=“hibernate.c3p0.timeout”>25200</property>
- <property name=“hibernate.c3p0.max_size”>15</property>
- <property name=“hibernate.c3p0.min_size”>3</property>
- <property name=“hibernate.c3p0.max_statements”>0</property>
- <property name=“hibernate.c3p0.preferredTestQuery”>select 1;</property>
- [mysqld]
- datadir=/var/lib/mysql
- socket=/var/lib/mysql/mysql.sock
- user=mysql
- # Disabling symbolic-links is recommended to prevent assorted security risks
- symbolic-links=0
- [mysqld_safe]
- log-error=/var/log/mysqld.log
- pid-file=/var/run/mysqld/mysqld.pid
Add Comment
Please, Sign In to add comment