Hi guys,
I got TimeoutException error again!
The error message is
(TimeoutException) com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@24a35978 -- timeout at awaitAvailable()
I have follow this thread :
to increase connection pool with this code
But It didn't work. I doubt it was because connection pool because the error raised a few seconds after app started.
Here are the codes that raised that error
Here are my settings
I got TimeoutException error again!
The error message is
(TimeoutException) com.mchange.v2.resourcepool.TimeoutException: A client timed out while waiting to acquire a resource from com.mchange.v2.resourcepool.BasicResourcePool@24a35978 -- timeout at awaitAvailable()
I have follow this thread :
TimeoutException
Hi guys, I have running jRDC2 for months without any errors, now suddenly, got TimeOut Exception Error on server. This error occurred randomly but always occurred after server starts. Have to restart jar file again to make it work again. Any idea what could cause this errors? Note ...
www.b4x.com
to increase connection pool with this code
B4X:
Sub Process_Globals
Public srvr As Server
Public rdcConnector1 As RDCConnector
Public PathToConfigFile As String
Type DBCommand (Name As String, Parameters() As Object)
Type DBResult (Tag As Object, Columns As Map, Rows As List)
Private dbpool As ConnectionPool
Private Tm As Timer
End Sub
Sub AppStart (Args() As String)
srvr.Initialize("")
If PathToConfigFile <> "" Then srvr.LogsFileFolder = PathToConfigFile
rdcConnector1.Initialize
srvr.Port = rdcConnector1.serverPort
srvr.AddHandler("/rdc", "RDCHandler", False)
srvr.Start
dbpool.Initialize( "org.firebirdsql.jdbc.FBDriver",....)
Dim jo As JavaObject = dbpool
jo.RunMethod("setMaxPoolSize", Array As Object(100))
Tm.Initialize("TM",10000)
Tm.Enabled = True
StartMessageLoop
End Sub
But It didn't work. I doubt it was because connection pool because the error raised a few seconds after app started.
Here are the codes that raised that error
B4X:
Sub TM_Tick
Private Qry1,Qry2,Qry3 As SQL
Private RS1,RS2,RS3 As ResultSet
Private RowsExist As Boolean
Tm.Enabled = False
Try
Qry1 = dbpool.GetConnection
RS1 = Qry1.ExecQuery("SELECT * from table1 rows 1")
RowsExist= False
Do While RS1.NextRow
'do some proses'
RowsExist= True
Loop
If RowsExist Then
'do some proses'
End If
Qry2 = dbpool.GetConnection
RS2 = Qry2.ExecQuery("SELECT * from table2 rows 1")
RowsExist= False
Do While RS2.NextRow
'do some proses'
RowsExist= True
Loop
If RowsExist Then
'do some proses'
End If
Qry3 = dbpool.GetConnection
RS3 = Qry3.ExecQuery("SELECT * from table3 rows 1")
RowsExist= False
Do While RS3.NextRow
'do some proses'
RowsExist= True
Loop
If RowsExist Then
'do some proses'
End If
Catch
File.WriteString(File.DirApp,"Error.err",LastException)
End Try
RS1.Close
Qry1.Close
RS2.Close
Qry2.Close
RS3.Close
Qry3.Close
Tm.Enabled = True
End Sub
Here are my settings
- B4J ver 7.32
- JavaObject ver 2.06
- jNet ver 1.80
- jRandomAccesFile ver 2.32
- jServer ver 3.00
- jSQL ver 1.60