B4J Question RDC MySQL - max allowed packet size

derez

Expert
Licensed User
Longtime User
I want to increase the allowed size for data sent to my Mysql server.
I have a line in the config.properties file :
B4X:
sql.setsize=SET GLOBAL max_allowed_packet=?
In the application I use this code:
B4X:
cmd.Initialize
cmd.Name = "setsize"
cmd.Parameters = Array As Object(2097152)
reqManager.ExecuteCommand(cmd,"setsize")
But I get this in the server log:
(ArrayIndexOutOfBoundsException) java.lang.ArrayIndexOutOfBoundsException: 20

I don't understand the "20" !
I tried many other values but they all fail. I know it has to be a multiple of 1024.
Any number smaller then 1024, like 1023, produces this error:
(MySQLSyntaxErrorException) com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Variable 'max_allowed_packet' can't be set to the value of '1023'

Any advice ?

Edit: I think that although there is an error, the requested operation is done.
 
Last edited:

derez

Expert
Licensed User
Longtime User
Yes, last two lines here are from the packet size command:
Waiting for debugger to connect...
Program started.
2017-03-19 12:00:19.766:INFO::main: Logging initialized @744ms
Mar 19, 2017 12:00:19 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Mar 19, 2017 12:00:19 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.2.1 [built 20-March-2013 11:16:28 +0000; debug? true; trace: 10]
2017-03-19 12:00:20.066:INFO:eek:ejs.Server:main: jetty-9.3.z-SNAPSHOT
2017-03-19 12:00:20.103:INFO:eek:ejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@3c0f93f1{/,file:///D:/B4J/Family_MyRDC_server/Objects/www,AVAILABLE}
2017-03-19 12:00:20.105:INFO:eek:ejs.AbstractNCSARequestLog:main: Opened D:\B4J\Family_MyRDC_server\Objects\logs\b4j-2017_03_19.request.log
2017-03-19 12:00:20.164:INFO:eek:ejs.ServerConnector:main: Started ServerConnector@23faf8f2{HTTP/1.1,[http/1.1]}{0.0.0.0:54025}
2017-03-19 12:00:20.164:INFO:eek:ejs.Server:main: Started @1144ms
Emulated network latency: 100ms
jRDC is running (version = 2.1)
Mar 19, 2017 12:00:33 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: 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, dataSourceName -> 1hgf1fm9m1rtidn61y7x1ui|5479e3f, debugUnreturnedConnectionStackTraces -> false, description -...
Class not found: derez.myfamily5.main$_dbcommand, trying: b4j.example.main$_dbcommand
Command: query: getnew, took: 3247ms, client=10.100.102.1
(ArrayIndexOutOfBoundsException) java.lang.ArrayIndexOutOfBoundsException: 20
Command: , took: 6ms, client=10.100.102.1
 
Last edited:
Upvote 0
Top