Descriptiondatabase/sql: move pooling logic into seperate plugable interface, added ability to chain drivers.
Added the following interfaces:
ConnChecker
ChainableDriver
ChainedDriver
PoolableDriver
Pool
PooledStmt
Add new function OpenChain that allows creation of a driver chain and/or configuration of the default pool.
Default PoolableDriver's Pool implementation includes the following
optional capabilities:
- Limit number of connections
- Maintain a minimum number of connections
- Opening new connections in mulitples
- Close idle connections after a specified timeout (default is immediately)
- Check the connection before returning it from the pool.
- Check all idle connections periodically
- Use a custom query to check the connection (instead of the ConnChecker interface)
- Use the new ErrDBLimitExceeded (if returned by driver) to scale back the connection limit
- Configure the number of times to try acquiring a new connection before considering the DB dead and stoping all connection attempts
- Configure the delay before retrying a failed connection attempt.
- Configure an acquisition timeout. If set, the pool will return ErrOpenTimeout if it could not return a connection from the pool before the timeout.
Patch Set 1 #Patch Set 2 : diff -r 5e23075b0970 https://code.google.com/p/go #Patch Set 3 : diff -r 5e23075b0970 https://code.google.com/p/go #
Total comments: 6
Patch Set 4 : diff -r 5e23075b0970 https://code.google.com/p/go #
Total comments: 10
Patch Set 5 : diff -r 5e23075b0970 https://code.google.com/p/go #Patch Set 6 : diff -r 30c566874b83 https://code.google.com/p/go #Patch Set 7 : diff -r 30c566874b83 https://code.google.com/p/go #Patch Set 8 : diff -r d29da2ced72b https://code.google.com/p/go #Patch Set 9 : diff -r d29da2ced72b https://code.google.com/p/go #
MessagesTotal messages: 23
|