- Your connection pool is not threadsafe / concurrently usable, if you are sure you do not need it to be ignore my points 1. to 3.
- Your pool does not offer connection locking (mutual exclusive usage of one Connection object) which is usually implemented by making the connection inaccessible after getConnection() and making it eligible for takeout after calling its close() method. You close the raw connections manually, leaving the pool in a broken state.
This is problematic: http://stackoverflow.com/questions/9428573/ https://stackoverflow.com/questions/9428573/ - Your counter int might return the same int for two concurrent calls at the same time. Use AtomicInteger / AtomicLong instead.
- Your pool does not implement connection testing: Your connections could expire at any time. You need to replace broken Connections with new Connections or your program might receive dead Connection objects!
- You might want to implement Closeable to close all connections at once when your application shuts down and clear the instance.
- You might want to throw if initializeConnections fails, because what are you supposed to do with a broken object?
- Hardcoding URLs that might change is not considered good practice
- Your connection pool is not threadsafe / concurrently usable, if you are sure you do not need it to be ignore my points 1. to 3.
- Your pool does not offer connection locking (mutual exclusive usage of one Connection object) which is usually implemented by making the connection inaccessible after getConnection() and making it eligible for takeout after calling its close() method. You close the raw connections manually, leaving the pool in a broken state.
This is problematic: http://stackoverflow.com/questions/9428573/ - Your counter int might return the same int for two concurrent calls at the same time. Use AtomicInteger / AtomicLong instead.
- Your pool does not implement connection testing: Your connections could expire at any time. You need to replace broken Connections with new Connections or your program might receive dead Connection objects!
- You might want to implement Closeable to close all connections at once when your application shuts down and clear the instance.
- You might want to throw if initializeConnections fails, because what are you supposed to do with a broken object?
- Hardcoding URLs that might change is not considered good practice
- Your connection pool is not threadsafe / concurrently usable, if you are sure you do not need it to be ignore my points 1. to 3.
- Your pool does not offer connection locking (mutual exclusive usage of one Connection object) which is usually implemented by making the connection inaccessible after getConnection() and making it eligible for takeout after calling its close() method. You close the raw connections manually, leaving the pool in a broken state.
This is problematic: https://stackoverflow.com/questions/9428573/ - Your counter int might return the same int for two concurrent calls at the same time. Use AtomicInteger / AtomicLong instead.
- Your pool does not implement connection testing: Your connections could expire at any time. You need to replace broken Connections with new Connections or your program might receive dead Connection objects!
- You might want to implement Closeable to close all connections at once when your application shuts down and clear the instance.
- You might want to throw if initializeConnections fails, because what are you supposed to do with a broken object?
- Hardcoding URLs that might change is not considered good practice
- Your connection pool is not threadsafe / concurrently usable, if you are sure you do not need it to be ignore my points 1. to 3.
- Your pool does not offer connection locking (mutual exclusive usage of one Connection object) which is usually implemented by making the connection inaccessible after getConnection() and making it eligible for takeout after calling its close() method. You close the raw connections manually, leaving the pool in a broken state.
This is problematic: http://stackoverflow.com/questions/9428573/ - Your counter int might return the same int for two concurrent calls at the same time. Use AtomicInteger / AtomicLong instead.
- Your pool does not implement connection testing: Your connections could expire at any time. You need to replace broken Connections with new Connections or your program might receive dead Connection objects!
- You might want to implement Closeable to close all connections at once when your application shuts down and clear the instance.
- You might want to throw if initializeConnections fails, because what are you supposed to do with a broken object?
- Hardcoding URLs that might change is not considered good practice
lang-java