-
Notifications
You must be signed in to change notification settings - Fork 14
Pluggable Connection Pool #13
Comments
Hiya! Not sure how I could make it pluggable, as despite them having a unified API for getting the connections out, the config varies quite a bit. Do you have an example of c3p0 failing? Maybe post it as an issue on their project -- or if you have an example, I will swap c3P0 out for BoneCP or similar PS: Not sure why you forked the project, then changed the package structure, then removed the README and LICENSE and the tests. This will make any pull request impossible (and looks like trying to erase me from history) |
I can try to get an example of it failing, but like I said, I am sure it's With regards to forking and taking away your credit ;)... That was -Carter On Tuesday, July 23, 2013, Tim Yates wrote:
Carter Youngblood |
Do you have examples of the more specific termination and reconnection calls? Even if I switched to BoneCP, I'd need to implement these across all connections as again it would be hard to make it pluggable 😦 It might be easier in this case to create your own multi-threaded worker mod with business case methods that interact with JDBC (and your own connection pool), rather than using the jdbc-persistor |
I agree that the connection pool is not easily pluggable... I will test with the mod and see if the pool becomes an issue. I will attach a more detained example of our datasource using BoneCP later On Tuesday, July 23, 2013, Tim Yates wrote:
Carter Youngblood |
As for the forking thing, no worries. Had me worried for a while though ;-) It's inadvisable to change the package structure, as it makes any bugs/fixes you find really hard to push back, and the same for getting any updates i make back into your forked repo |
Completely agree! Let's chalk it up to a newbie Github user:). I have not I will make sure to rebase and start fresh with the forked repo. Another thought... Instead of pluggable... There could be 2 versions to On Tuesday, July 23, 2013, Tim Yates wrote:
Carter Youngblood |
Well I agree to make something plugable or it could be some sub-project support modules, like
On another matter if we care about performance, I strongly advises you to take a look at HikariCP jdbc pool, it shows really impressive numbers ! And actually highlight some issues in the BoneCP benchmarks. |
Oddly, I've been thinking about this since the stats for Hikari came out (I wonder if it works with Oracle, as it shows Not sure in my head how to implement this yet though, as there doesn't seem to be the functionality to dynamically include another module (I could have each connection pool as a system module deployed to maven) And I'm not sure you can send a DataSource across the message bus Any ideas? |
I don't think it will be possible to send the DS over the message bus. Actually I wasn't thinking about vert.x modules, but more something about modules you could put in the classpath. However I'm not sure if it works well if different datasources are needed in the app. It could be irrelevant it a verticle instance has it's own classloader, but I'm not sure how is the classloader infrastructure with vert.x |
I was wondering whether I could pass the pool to use in the config message to the jdbc-persistor (along with pool specific config), and then have the persistor load the relevant pool implementation as a mod into it's parent classloader (much as the Otherwise, I believe I'd need to maintain 3+ separate mod-jdbc-persistors, which is something I'd rather avoid ;-) Not sure if calling |
Also it's worthwhile to say the untested for Oracle driver is relative to the instrumentation mode only, which is optional. The performance using the delegate mode already shows remarkable numbers. |
Yeah having three different mod would be a pain to maintain. I would prefer – something like you said – to pass the config with the pool type, instantiate and configure it at runtime, meaning each handler instance has his own pool instance. We'll see what the mailing list says. About pools I also think tomcat-jdbc pool might be a worthwhile support as well, as the codebase is recent, and haven't shown yet issues regarding leaks, deadlocks, etc. |
Looks like runtime mod includes are on the task list for a future version of vert.x, so I'll wait until then to look into this |
Indeed, it the meantime what do you think to be able to put a support jar in the |
Sorry, I'm having a stupid moment... How would it then know to load the correct pool implementation, and pass pool configuration? |
Sorry too sometimes not everything comes out of my head ;) About the dependencies stuff, I think And the above could easily be adapted to a json payload. <Resource name="jdbc/IntegDB"
auth="Container"
type="javax.sql.DataSource"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="SELECT 1"
validationInterval="30000"
timeBetweenEvictionRunsMillis="30000"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="10"
removeAbandonedTimeout="60"
removeAbandoned="true"
logAbandoned="true"
minEvictableIdleTimeMillis="30000"
jmxEnabled="true"
username="schema"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://databases.integ:3306/mysql"/> |
We have had some bad experience int he past with C3PO - mainly leaking connections and not closing properly. I am sure it more to do with the settings used and our custom JDBC driver.
We have been using BoneCP with a lot of success!
I wanted to get your thoughts on a configurable connection pool?
One of the nice things about BoneCP is they provide a connection hook, to be able to perform specifc logic around when to terminate a connection/all connections. I am not sure how this would be supported in the module.
Thanks,
Carter
The text was updated successfully, but these errors were encountered: