B4J Question RDC2 and SQLITE_IOERR

marcick

Well-Known Member
Licensed User
Longtime User
Sometimes happens that on my RDC2 app I have this error

B4X:
(SQLException) java.sql.SQLException: [SQLITE_IOERR]  Some kind of disk I/O erro
r occurred (disk I/O error)

Still have to understand the code line that generate the error.
Any vague idea about this ?
When I fall in this situation the error then happens continuously and to solve I have to restart the app
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Thank you. I see I have two timers that contains "con1 = rdcConnector1.GetConnection" (con1 is public).
So: if timer1 execute that statement and before it close the connection timer2 do the same i fall in the above error ?
is this situation called "concurrent access" ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Yes Erel, I have integrated JRDC2 with the PushServer but it's difficult now to see what is chenged.
Is this all is needed to solve ?

B4X:
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
    Config = LoadConfigMap
    pool.Initialize(Config.Get("DriverClass"), Config.Get("JdbcUrl"), Config.Get("User"), _
        Config.Get("Password"))
#if DEBUG
    DebugQueries = True
#else
    DebugQueries = False
#end if   
    serverPort = Config.Get("ServerPort")
    LoadSQLCommands(Config)
    Dim jo As JavaObject = pool  ' added line
    jo.RunMethod("setMaxPoolSize", Array(1))  ' added line
    jo.RunMethod("setMinPoolSize", Array(1)) ' added line
End Sub
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I have this warning in the log

B4X:
WARNING: Bad pool size config, start 3 > max 1. Using 1 as start.

and this error also ...

B4X:
java.lang.RuntimeException: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
be patient ..... I'm no longer a fresh mind

Everywhere I have a getconnection I have to set the WAL ?

B4X:
con1 = rdcConnector1.GetConnection
con1.ExecNonQuery("PRAGMA journal_mode = wal")

' do what I need

If con1 <> Null And con1.IsInitialized Then con1.Close
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I'm becoming crazy

This is my App_Start

B4X:
Sub AppStart (Args() As String)
    rdcConnector1.Initialize
    con1 = rdcConnector1.GetConnection
    con1.ExecNonQuery("PRAGMA journal_mode=WAL")

And this is the log

B4X:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PRAGMA journal_mode=WAL' at line 1

Where I'm wrong ?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
You're right, I'm in total confusion. But WAL mode is related only to SqLite, not MySQL, right ?
 
Upvote 0
Top