Advertisement
Guest User

Untitled

a guest
Jan 30th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. 1.Copy postgresql jar glassfish4/glassfish/domains/domain1/lib/ext
  2. 2.start glassfish
  3. asadmin start-domain
  4. 3.Create Connection Pool (DataSource)
  5. asadmin create-jdbc-connection-pool
  6. --datasourceclassname org.postgresql.ds.PGSimpleDataSource
  7. --restype javax.sql.DataSource
  8. --property user=USER_NAME:password=PASSWORD:DatabaseName=DB_NAME:ServerName=HOST_NAME:port=PORT_NAME
  9. postgresql-pool(DataSource Name)
  10.  
  11. Optional
  12. 4.Setting min/max sizes - via the command line
  13. To set the initial & minimum pool size:
  14. asadmin set resources.jdbc-connection-pool.test-pool.steady-pool-size=10
  15. To set the maximum pool size:
  16. asadmin set resources.jdbc-connection-pool.test-pool.max-pool-size=200
  17.  
  18. 5.Connection Validation
  19. asadmin set resources.jdbc-connection-pool.postgresql-pool.connection-validation-method=custom-validation
  20. asadmin set resources.jdbc-connection-pool.postgresql-pool.validation-classname=org.glassfish.api.jdbc.validation.PostgresConnectionValidation
  21. asadmin set resources.jdbc-connection-pool.postgresql-pool.is-connection-validation-required=true
  22.  
  23.  
  24.  
  25. You can also set whether to close all connections on failure with the following command:
  26. asadmin set resources.jdbc-connection-pool.postgresql-pool.fail-all-connections=true
  27.  
  28. 6.Statement and Connection Leak Detection
  29. asadmin set resources.jdbc-connection-pool.postgresql-pool.statement-leak-timeout-in-seconds=5
  30. asadmin set resources.jdbc-connection-pool.postgresql-pool.connection-leak-timeout-in-seconds=5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement