mySQL = pool.GetConnection
WARNING: package com.sun.javafx.embed.swing.oldimpl not in javafx.swing
Waiting for debugger to connect...
Program started.
2023-10-13 14:58:14.935:INFO :cmvl.MLog:MLog-Init-Reporter: MLog clients using slf4j logging.
2023-10-13 14:58:15.239:INFO :cmvc.C3P0Registry:JavaFX Application Thread: Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10]
2023-10-13 14:59:34.263:INFO :cmvci.AbstractPoolBackedDataSource:JavaFX Application Thread: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 20000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 2s76dfazbaermw2g45ih|1cb3dfb7, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 2s76dfazbaermw2g45ih|1cb3dfb7, idleConnectionTestPeriod -> 600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://10.8.0.2:3306/stancontrol?allowPublicKeyRetrieval=false&connectTimeout=5000&socketTimeout=500000&maxIdleTime=300&requireSSL=false&useSSL=false&pooling=false, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 1800, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 150, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {password=******, user=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> true, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
In a pooled environment, it is recommended to use on pooled connection per sql statement or sets of sql statements that belong together. This is to avoid locking out pool connections from other threads. It's the whole purpose of having a pool. It is up to you to decide if you want to follow that advice. If you don't, you may run out of connections within the pool, which then will require you to increase the amount of connections the pool has to maintain. Hikari actually says less is more (depending on CPU count / thread count, etc) and 10 should work for many cases! But that only works if one is careful in getting and realeasing pooled connection. Please note, if you need to increase your pool size to something like 100 or even 200 as mentioned in this thread, you may be doing something wrong, or your environment is really not right for pooling. Do you really think the server is going to process 100+ connections at one time? If so, that must be some impressive hardware.There are tons of subs inside the app where the DB is used - is a new connection to be opened at each sub and closed at sub finish ?
IsInitialized has nothing to do with the pool properly connecting/being properly configured. All what this tells you is that the Object variable named pool has been initialized. Also, C3P0 is lazy, and you will not know if the pool will connect to your DB until you use the first connection. At that point, if there are any issues, you will see some exception errors thrown.pool.IsInitialized is always = TRUE
Why to check it then...pool.initialize will run successfully even if you give wrong credentials
No any files in the DB. Just huge DB with high load from one app, and in future - from several similar extra apps on the LAN.if you are storing large image files in the DB
' Dim loginfrm As Login
'
' loginfrm.Initialize(DBInfo)
DBInfo.server = "Your server"
DBInfo.port = 3306 'or you server port
DBInfo.schema = "Your schema"
DBInfo.username = "Your username"
DBInfo.password = "Your password"
If you run into any connection issues using the ConnectionPool object, use standard JDBC calls (w/o pooling) to verify the SQL connection first. If plain JDBC can connect, then it is very likely that ConnectionPool will be able to connect. In B4X, that means is the SQL object/library to connect, and once that works, use the ConnectionPool object to connect.at any password, login....any credentials
Now only this way is started to work errorlessly, when the parameters are set so, to the single public SQL object directly, without pool. Before it gave the error.standard JDBC calls (w/o pooling)
SQL.Initialize2("com.mysql.jdbc.Driver", $"jdbc:mysql://${DBLocation}/${DBname}?characterEncoding=utf8&allowPublicKeyRetrieval=false&autoReconnect=false&requireSSL=false&useSSL=false&pooling=false"$, DBUsername, DBPassword)
They should not hang, and what errors are you experiencing? If you need to do very long running, multiple SQL statements per call to your server, then just use and SQL object per call to that server that Initializes the connection privately for its own use only. You may have one of the edge cases that does not work properly with Pooling. It could also be that your app is perfect for pooling, but it is not properly set up to do so.Any "mySQL = pool.GetConnection" hangs the app till the die with error.
Something is wrong then...Why to check it then...
Now i'm not sure that connected OK to my server from my PC where your UI example is running. Both are in one LAN...
Any "mySQL = pool.GetConnection" hangs the app till the die with error.
Andreas.No any files in the DB. Just huge DB with high load from one app, and in future - from several similar extra apps on the LAN.
It's about the test app from @amykonio that running not at the server but at my PC.should not hang
It was reply not to you.Don't understand what you mean here
1) Use a pool and set up it's keep-alive option ( ???)BTW, how to be sure that remote connection to MySQL is OK ?
That's what ABMaterial uses. It's actually part of jServer (if you use jServer, you have access to ConnectionPool). Someone else extracted it and it can be used standalone.Is this some special installation of this pool software ?
Or execute "select connection_id()" which will also return your session id (there are cases you will need that information, example for debugging)...2) Do a "SELECT 1" query first. If it works, you're good to go
No. He tries to connect to a mysql server that runs on his computer.I ve noticed you ve said that you are trying Andreas app from your pc... trying to connect at the same db...?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?