K keirS Well-Known Member Licensed User Longtime User Apr 10, 2014 #1 Is it possible to use a c3po-config.xml file to configure the connection pooling? I assume it would go in the files folder if it's possible.
Is it possible to use a c3po-config.xml file to configure the connection pooling? I assume it would go in the files folder if it's possible.
Erel B4X founder Staff member Licensed User Longtime User Apr 10, 2014 #2 Currently no. The default settings are: Code: pool.setMaxStatements(150); pool.setMaxIdleTime(1800); pool.setIdleConnectionTestPeriod(600); pool.setCheckoutTimeout(20000); pool.setTestConnectionOnCheckout(true); You can use JavaObject to call these or other methods: http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ComboPooledDataSource.html Code: Dim jo As JavaObject = pool jo.RunMethod("setMaxIdleTime", Array As Object(3600)) Which settings do you need to change? Upvote 0
Currently no. The default settings are: Code: pool.setMaxStatements(150); pool.setMaxIdleTime(1800); pool.setIdleConnectionTestPeriod(600); pool.setCheckoutTimeout(20000); pool.setTestConnectionOnCheckout(true); You can use JavaObject to call these or other methods: http://www.mchange.com/projects/c3p0/apidocs/com/mchange/v2/c3p0/ComboPooledDataSource.html Code: Dim jo As JavaObject = pool jo.RunMethod("setMaxIdleTime", Array As Object(3600)) Which settings do you need to change?
K keirS Well-Known Member Licensed User Longtime User Apr 10, 2014 #3 I want to be able set the maxpoolsize as there is a connection limit per user on the DB server I am looking at ;and I don't want to adversely affect the other users in terms of performance. Upvote 0
I want to be able set the maxpoolsize as there is a connection limit per user on the DB server I am looking at ;and I don't want to adversely affect the other users in terms of performance.
Erel B4X founder Staff member Licensed User Longtime User Apr 10, 2014 #4 You can set it with: Code: jo.RunMethod("setMaxPoolSize", Array As Object(<max size>)) Upvote 0
vfafou Well-Known Member Licensed User Longtime User Mar 23, 2015 #6 keirS said: I want to be able set the maxpoolsize as there is a connection limit per user on the DB server I am looking at ;and I don't want to adversely affect the other users in terms of performance. Click to expand... Hello keirS. I would like to ask you if it is correct to close the pool after every transaction! And then, will the connection be done automatically with BeginTransaction? Or I have to manually connect it again? Thank you in advance! Upvote 0
keirS said: I want to be able set the maxpoolsize as there is a connection limit per user on the DB server I am looking at ;and I don't want to adversely affect the other users in terms of performance. Click to expand... Hello keirS. I would like to ask you if it is correct to close the pool after every transaction! And then, will the connection be done automatically with BeginTransaction? Or I have to manually connect it again? Thank you in advance!
K keirS Well-Known Member Licensed User Longtime User Mar 23, 2015 #7 vfafou said: Hello keirS. I would like to ask you if it is correct to close the pool after every transaction! And then, will the connection be done automatically with BeginTransaction? Or I have to manually connect it again? Thank you in advance! Click to expand... No. That would defeat the whole point of pooling. Upvote 0
vfafou said: Hello keirS. I would like to ask you if it is correct to close the pool after every transaction! And then, will the connection be done automatically with BeginTransaction? Or I have to manually connect it again? Thank you in advance! Click to expand... No. That would defeat the whole point of pooling.