I've got a large program (too big to show here), but there is one line of code that, when present, causes the dreaded 15740 error:
You are trying to use a multi-threaded .NET object in a way that is not supported. The ABL cannot be called on a thread other than the main thread. (15740)
The ABL is single threaded. You will see this error if you use a .NET object that employs multiple threads and attempts to call back to the ABL on a thread other than the main processing thread.
Json = (NEW utilities.JsonParser()):GetJson(p_Data)
using Progress.Json.ObjectModel.*.routine-level on error undo, throw.class utilities.JsonParser:method public JsonObject GetJson(p_Data as longchar ):def var lv_Data as longchar no-undo.fix-codepage(lv_Data) = "UTF-8". /** force to utf-8, otherwise the parse method borks */assign lv_Data = p_Data.return cast((new ObjectModelParser()):Parse(lv_Data),Progress.Json.ObjectModel.JsonObject).catch e as Progress.Lang.Error :return new Progress.Json.ObjectModel.JsonObject().end catch.end method.end class.
ok, breaking it down, removing all the fancy stuff,
JsonConstruct1 = JsonObjectModel1:Parse(lv_Data).
A fuller version is shown below.
is where the error ocurrs according to the protrace file.
def var JsonConstruct1 as Progress.Json.ObjectModel.JsonConstruct no-undo.
def var JsonObjectModel1 as Progress.Json.ObjectModel.ObjectModelParser no-undo.
fix-codepage(lv_Data) = "UTF-8". /** force to utf-8, otherwise the parse method borks */
assign lv_Data = p_Data.
JsonObjectModel1 = new ObjectModelParser().
JsonConstruct1 = JsonObjectModel1:Parse(lv_Data).
jmls wrote:
ok, breaking it down, removing all the fancy stuff,
JsonConstruct1 = JsonObjectModel1:Parse(lv_Data).
A fuller version is shown below.
is where the error ocurrs according to the protrace file.
def var JsonConstruct1 as Progress.Json.ObjectModel.JsonConstruct no-undo.
def var JsonObjectModel1 as Progress.Json.ObjectModel.ObjectModelParser no-undo.
fix-codepage(lv_Data) = "UTF-8". /** force to utf-8, otherwise the parse method borks */
assign lv_Data = p_Data.
JsonObjectModel1 = new ObjectModelParser().
JsonConstruct1 = JsonObjectModel1:Parse(lv_Data).
Sounds buggy to me. Does it always happen, or only with certain data?
-- peter
The OpenEdge JSON API provided in the language utilizes a 3rd party package for some processing. The JSON framework written by OpenEdge development does not take advantage of multi-threading. Additional research needs to be done to determine if any facilities we used took utilized multi-threading - our expectation was that they also do not.
If you have a code sample which reproduces this behavior, please submit it with Technical Support, so that we can look into this issue.
Evan
Hi Julian,
Just a shot in the dark but can you try fully qualifying the class name everywhere. I want to rule out that the compiler got confused on resolving the classname.
JsonObjectModel1 = new ObjectModelParser().
becomes
JsonObjectModel1 = new Progress.Json.ObjectModelParser().
etc...
Thanks
-Shelley
it was any json data
I'll see if I can reproduce this outside the application
Yeah, I would try that, but I've since recompiled and (of course) the
damned thing is now working.
Would it be useful for you to have the protrace files if I still have them ?
Hi Julian:
If you have the protrace files, you can send them to me (bleicher@progress.com). Without a reproducible test case, this will probably not shed any light on what was occurring prior to your recompilation.
Evan
man, I've just started hitting this again :( 11.3
will try and get the reports / data