B4J Question B4J - RDC problem

johnB

Active Member
Licensed User
Longtime User
I've been using RDC in B2A and B4J since it was first released and have had no problems until now.

I don't know if this problem will happen in B4A because I do my development in B4J and when it's working, transfer it to B4A, simply for the ease of testing and checking the Sql database tables.

The problem I'm encountering is that I'm submitting up to 100 jobs (it could be more) thru RDC and when I'm running in Debug mode, it is generally not returning all the jobs - I keep track of the jobs submitted and returned.

If I reload the B4J compiler/editor and compile/run it in debug mode it always returns the right number of jobs the first time, but if I run it again, either with or without a recompilation, it generally doesn't not return the right number of jobs, occasionally it does.

If I run it in release mode it always seems to return the right number of jobs.

Any help, suggestions would be gratefully received

Forgot to Say that I'm using V3.5 Beta 1 of B4J
 
Last edited:

johnB

Active Member
Licensed User
Longtime User
Sorry, so I should download v3.5 - not Beta
And yes I have two breakpoints in the sections that I'm having problems with but they are after where I check that the number of jobs outstanding is 0 but I understand that it still executing this code for every job so - Should I take them out??

And I'll Ctrl P also but I'm sure that I've done this recently
 
Upvote 0

johnB

Active Member
Licensed User
Longtime User
Thanks Erel

I've removed all the breakpoints, downloaded v3.5 Live and cleaned the project.

When I was dealing with about 40 RDC jobs it was working fine but when I increased it to around 90 it still didn't complete all the jobs, (sometimes it did).

I took out any Log(s) that were in JobDone and it seems to be running in Debug mode (I think that it always runs in Release but haven't tried it again today).

But at this stage I can't tell whether, if I rerun the RDC job (different selection of dates with the same compilation) it will complete all the jobs because it's falling over in my logic after returning the Jobs. I've been concentrating on getting this fixed. I'll fix the coding error and update the status
 
Upvote 0

johnB

Active Member
Licensed User
Longtime User
Erel

I've still got the same problem.

It always runs in Release mode

It seems to run on the first compile in Debug mode after loading the editor/compiler

It seemed that after I took out the breakpoints and Logs, it had made a difference but that just appears to be an aberration.

I reloaded v2.8 with the same result.

What does appear to be different is the in Debug mode it is falling over on the following code unless I breakpoint it, then it's Ok and is obviously works in Release mode
and I think that it worked in v2,8. This part of codeing has been in the program since the begining and have never had a problem with it before - the reason that I mention it here is that it related to setting up the parameters for RDC

B4X:
        paramsA = Regex.Split("&",params)
        'Log(paramsA(0) & " " & paramsA(1))
        cmd.Parameters = Array As Object(paramsA(0), paramsA(1), paramsA(2), paramsA(3), paramsA(4), paramsA(5), paramsA(6), paramsA(7), paramsA(8), paramsA(9), paramsA(10))
        reqManager.ExecuteQuery(cmd, 0, 01)

It falls over on the cmd.Parameters = Array as Object ..... line unless it's breakpointed or in Release mode

I've got the B4J program working now so I'll transfer the code to B4A and see what happens

Regards
 
Upvote 0

johnB

Active Member
Licensed User
Longtime User
Sorry Erel, I should have included this in the previous post

B4X:
.
Error occurred on line: 187 (main).
java.lang.ArrayIndexOutOfBoundsException: 2
    at b4j.Portfolio03.main._executetableview_sql2(main.java:320)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:563)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:156)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:82)
    at anywheresoftware.b4a.BA$2.run(BA.java:165)
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
    at com.sun.javafx.application.PlatformImpl$$Lambda$48/305815329.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
    at com.sun.javafx.application.PlatformImpl$$Lambda$47/1915503092.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101)
    at com.sun.glass.ui.win.WinApplication$$Lambda$36/1963387170.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

Line 187 is obviously the cmd.Parameters = ............ line

Of the 11 parameters, the 11th (paramsA(10)) is always a date and always present, the other 10 are equity codes and can be null, but there will always be at least one ie
at least paramsA(0) will be filled
 
Upvote 0

johnB

Active Member
Licensed User
Longtime User
Erel

I may have solved it, let me do more testing

I'll post the answer when I'm sure and it may explain why I initially thought that I had success initially but then thought that I was an aberration.

Regards
 
Upvote 0
Top