User Tools

Site Tools


java:java

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

java:java [2022/07/26 06:59] – [c3p0 connection pool] adminjava:java [2022/10/29 16:15] (current) – external edit 127.0.0.1
Line 562: Line 562:
   * **Atomic variables** have features that minimize synchronization and help avoid memory consistency errors.   * **Atomic variables** have features that minimize synchronization and help avoid memory consistency errors.
   * **ThreadLocalRandom** (in JDK 7) provides **efficient generation of pseudorandom numbers from multiple threads**.   * **ThreadLocalRandom** (in JDK 7) provides **efficient generation of pseudorandom numbers from multiple threads**.
-=== Executor Interfaces === + 
-=== Thread pools ===+==== Thread pools ===
 +{{:java:thread-pool-tasks.png|}}
 refer:  refer: 
-  * https://docs.oracle.com/javase/tutorial/essential/concurrency/pools.html +  * https://www.baeldung.com/thread-pool-java-and-guava
-  * http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html+
   * http://howtodoinjava.com/2012/10/20/how-to-use-blockingqueue-and-threadpoolexecutor-in-java   * http://howtodoinjava.com/2012/10/20/how-to-use-blockingqueue-and-threadpoolexecutor-in-java
 +  * http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html
 Thread pools address two different problems:  Thread pools address two different problems: 
   * They usually provide improved performance when **executing large numbers of asynchronous tasks**, due to reduced per-task invocation overhead   * They usually provide improved performance when **executing large numbers of asynchronous tasks**, due to reduced per-task invocation overhead
Line 1252: Line 1253:
   * {{:java:pooling.jpg|}}   * {{:java:pooling.jpg|}}
  
-==== Hibernate connection pooling and mysql connection timeout ==== +==== Default Hibernate connection pooling ==== 
-Below are basic steps config for connections in Hibernate(each connection in MySQL was a session in Hibernate):+Below are basic steps config for connections in Hibernate(each connection in MySQL was a session in Hibernate)(refer: https://docs.jboss.org/hibernate/stable/core.old/reference/en/html/configuration-hibernatejdbc.html):
   - Config max connections in MySQL:   - Config max connections in MySQL:
     * config temporary in MySQL Admin console:<code sql>     * config temporary in MySQL Admin console:<code sql>
java/java.1658818793.txt.gz · Last modified: 2022/10/29 16:15 (external edit)